Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-04-24 15:52:53 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2c7f84049371f6024c58ef42a075f3e329d719b2
2c7f8404
1 parent
3a257bc5
Correction configuration FunkSVD
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/FunkSVDRecommender.java
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/FunkSVDRecommender.java
View file @
2c7f840
...
...
@@ -5,9 +5,14 @@ import org.grouplens.lenskit.ItemRecommender;
import
org.grouplens.lenskit.ItemScorer
;
import
org.grouplens.lenskit.RecommenderBuildException
;
import
org.grouplens.lenskit.baseline.BaselineScorer
;
import
org.grouplens.lenskit.baseline.ItemMeanRatingItemScorer
;
import
org.grouplens.lenskit.baseline.UserMeanBaseline
;
import
org.grouplens.lenskit.baseline.UserMeanItemScorer
;
import
org.grouplens.lenskit.core.LenskitConfiguration
;
import
org.grouplens.lenskit.core.LenskitRecommender
;
import
org.grouplens.lenskit.data.dao.EventDAO
;
import
org.grouplens.lenskit.data.dao.PrefetchingUserEventDAO
;
import
org.grouplens.lenskit.data.dao.UserEventDAO
;
import
org.grouplens.lenskit.data.history.RatingVectorUserHistorySummarizer
;
import
org.grouplens.lenskit.data.history.UserHistorySummarizer
;
import
org.grouplens.lenskit.data.pref.PreferenceDomain
;
...
...
@@ -38,7 +43,8 @@ public class FunkSVDRecommender implements Recommender {
config
.
bind
(
ItemScorer
.
class
).
to
(
FunkSVDItemScorer
.
class
);
config
.
bind
(
GlobalItemScorer
.
class
).
to
(
ItemItemGlobalScorer
.
class
);
config
.
bind
(
BaselineScorer
.
class
,
ItemScorer
.
class
).
to
(
FunkSVDItemScorer
.
class
);
config
.
bind
(
BaselineScorer
.
class
,
ItemScorer
.
class
).
to
(
UserMeanItemScorer
.
class
);
config
.
bind
(
UserMeanBaseline
.
class
,
ItemScorer
.
class
).
to
(
ItemMeanRatingItemScorer
.
class
);
config
.
bind
(
PreferenceDomain
.
class
).
to
(
new
PreferenceDomain
(
1.0
,
5.0
,
1.0
));
config
.
bind
(
UserHistorySummarizer
.
class
).
to
(
RatingVectorUserHistorySummarizer
.
class
);
...
...
@@ -47,8 +53,11 @@ public class FunkSVDRecommender implements Recommender {
delimitedColumnEventFormat
.
setHeaderLines
(
1
);
delimitedColumnEventFormat
.
setFields
(
Fields
.
item
(),
Fields
.
user
(),
Fields
.
rating
());
TextEventDAO
textEventDAO
=
new
TextEventDAO
(
new
File
(
filePath
),
delimitedColumnEventFormat
);
config
.
bind
(
EventDAO
.
class
).
to
(
textEventDAO
);
EventDAO
eventDAO
=
new
TextEventDAO
(
new
File
(
filePath
),
delimitedColumnEventFormat
);
config
.
bind
(
EventDAO
.
class
).
to
(
eventDAO
);
UserEventDAO
userEventDAO
=
new
PrefetchingUserEventDAO
(
eventDAO
);
config
.
bind
(
UserEventDAO
.
class
).
to
(
userEventDAO
);
LenskitRecommender
rec
;
...
...
Please
register
or
login
to post a comment