public class LenskitTestUser extends AbstractTestUser
Constructor and Description |
---|
LenskitTestUser(LenskitRecommender rec,
UserHistory<Event> testData)
Construct a new test user.
|
Modifier and Type | Method and Description |
---|---|
SparseVector |
getPredictions()
Get the user's predictions.
|
List<ScoredId> |
getRecommendations(int n,
ItemSelector candSel,
ItemSelector exclSel)
Get the user's recommendations.
|
LenskitRecommender |
getRecommender()
Get the recommender
|
UserHistory<Event> |
getTestHistory()
Return this user's test history.
|
UserHistory<Event> |
getTrainHistory()
Return this user's training history.
|
getTestRatings, getUserId
public LenskitTestUser(LenskitRecommender rec, UserHistory<Event> testData)
rec
- The LensKit recommender.testData
- The user history to test.public UserHistory<Event> getTrainHistory()
TestUser
public UserHistory<Event> getTestHistory()
TestUser
public SparseVector getPredictions()
TestUser
null
if the algorithmInfo
does not support rating prediction.public List<ScoredId> getRecommendations(int n, ItemSelector candSel, ItemSelector exclSel)
TestUser
n
- The number of recommendations to generate.candSel
- The candidate selector.exclSel
- The exclude selector.null
if the recommender does not
support recommendation.ItemRecommender.recommend(long, int, java.util.Set,
java.util.Set)
public LenskitRecommender getRecommender()
TestUser