|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.ratingprediction.RatingPredictor
org.mymedialite.ratingprediction.IncrementalRatingPredictor
public abstract class IncrementalRatingPredictor
Base class for rating predictors that support incremental training
Field Summary | |
---|---|
protected boolean |
updateItems
|
protected boolean |
updateUsers
|
Fields inherited from class org.mymedialite.ratingprediction.RatingPredictor |
---|
maxItemID, maxRating, maxUserID, minRating, ratings |
Constructor Summary | |
---|---|
IncrementalRatingPredictor()
Default constructor. |
Method Summary | |
---|---|
void |
addItem(int itemId)
|
void |
addRating(int userId,
int itemId,
double rating)
Add a new rating and perform incremental training |
void |
addUser(int userId)
|
boolean |
getUpdateItems()
true if items shall be updated when doing incremental updates. |
boolean |
getUpdateUsers()
true if users shall be updated when doing incremental updates. |
void |
removeItem(int itemId)
Remove an item from the recommender model, and delete all ratings of this item It is up to the recommender implementor whether there should be model updates after this action, both options are valid. |
void |
removeRating(int userId,
int itemId)
Remove an existing rating and perform "incremental" training |
void |
removeUser(int userId)
Remove a user from the recommender model, and delete all their ratings It is up to the recommender implementor whether there should be model updates after this action, both options are valid. |
void |
setUpdateItems(boolean updateItems)
Set to true if items shall be updated when doing incremental updates. |
void |
setUpdateUsers(boolean updateUsers)
Set to true if users shall be updated when doing incremental updates. |
void |
updateRating(int userId,
int itemId,
double rating)
Update an existing rating and perform incremental training |
Methods inherited from class org.mymedialite.ratingprediction.RatingPredictor |
---|
canPredict, clone, getMaxRating, getMinRating, getRatings, loadModel, predict, saveModel, setMaxRating, setMinRating, setRatings, toString, train |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mymedialite.ratingprediction.IRatingPredictor |
---|
getMaxRating, getMinRating, setMaxRating, setMinRating |
Methods inherited from interface org.mymedialite.IRecommender |
---|
canPredict, loadModel, predict, saveModel, toString, train |
Field Detail |
---|
protected boolean updateUsers
protected boolean updateItems
Constructor Detail |
---|
public IncrementalRatingPredictor()
Method Detail |
---|
public void addRating(int userId, int itemId, double rating)
IIncrementalRatingPredictor
addRating
in interface IIncrementalRatingPredictor
userId
- the ID of the user who performed the ratingitemId
- the ID of the rated itemrating
- the rating valuepublic void updateRating(int userId, int itemId, double rating) throws java.lang.IllegalArgumentException
IIncrementalRatingPredictor
updateRating
in interface IIncrementalRatingPredictor
userId
- the ID of the user who performed the ratingitemId
- the ID of the rated itemrating
- the rating value
java.lang.IllegalArgumentException
public void removeRating(int userId, int itemId)
IIncrementalRatingPredictor
removeRating
in interface IIncrementalRatingPredictor
userId
- the ID of the user who performed the ratingitemId
- the ID of the rated itempublic void addUser(int userId)
public void addItem(int itemId)
public void removeUser(int userId)
IIncrementalRatingPredictor
removeUser
in interface IIncrementalRatingPredictor
userId
- the ID of the user to be removedpublic void removeItem(int itemId)
IIncrementalRatingPredictor
removeItem
in interface IIncrementalRatingPredictor
itemId
- the ID of the user to be removedpublic boolean getUpdateUsers()
IIncrementalRatingPredictor
getUpdateUsers
in interface IIncrementalRatingPredictor
public void setUpdateUsers(boolean updateUsers)
IIncrementalRatingPredictor
setUpdateUsers
in interface IIncrementalRatingPredictor
public boolean getUpdateItems()
IIncrementalRatingPredictor
getUpdateItems
in interface IIncrementalRatingPredictor
public void setUpdateItems(boolean updateItems)
IIncrementalRatingPredictor
setUpdateItems
in interface IIncrementalRatingPredictor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |