|
|||||||||
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
org.mymedialite.ratingprediction.EntityAverage
org.mymedialite.ratingprediction.ItemAverage
public class ItemAverage
Uses the average rating value of an item for prediction. This engine does NOT support online updates.
Field Summary |
---|
Fields inherited from class org.mymedialite.ratingprediction.EntityAverage |
---|
entity_averages, global_average |
Fields inherited from class org.mymedialite.ratingprediction.IncrementalRatingPredictor |
---|
updateItems, updateUsers |
Fields inherited from class org.mymedialite.ratingprediction.RatingPredictor |
---|
maxItemID, maxRating, maxUserID, minRating, ratings |
Constructor Summary | |
---|---|
ItemAverage()
|
Method Summary | |
---|---|
void |
addItem(int item_id)
|
void |
addRating(int user_id,
int item_id,
double rating)
Add a new rating and perform incremental training |
boolean |
canPredict(int user_id,
int item_id)
Check whether a useful prediction can be made for a given user-item combination. |
double |
predict(int user_id,
int item_id)
Predict the rating or score for a given user-item combination. |
void |
removeItem(int item_id)
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 user_id,
int item_id)
Remove an existing rating and perform "incremental" training |
java.lang.String |
toString()
Return a string representation of the recommender |
void |
train()
Learn the model parameters of the recommender from the training data |
void |
updateRating(int user_id,
int item_id,
double rating)
Update an existing rating and perform incremental training |
Methods inherited from class org.mymedialite.ratingprediction.EntityAverage |
---|
get, loadModel, retrain, saveModel, train |
Methods inherited from class org.mymedialite.ratingprediction.IncrementalRatingPredictor |
---|
addUser, getUpdateItems, getUpdateUsers, removeUser, setUpdateItems, setUpdateUsers |
Methods inherited from class org.mymedialite.ratingprediction.RatingPredictor |
---|
clone, getMaxRating, getMinRating, getRatings, setMaxRating, setMinRating, setRatings |
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 |
Constructor Detail |
---|
public ItemAverage()
Method Detail |
---|
public void train()
IRecommender
train
in interface IRecommender
train
in class RatingPredictor
public boolean canPredict(int user_id, int item_id)
IRecommender
canPredict
in interface IRecommender
canPredict
in class RatingPredictor
user_id
- the user IDitem_id
- the item ID
public double predict(int user_id, int item_id)
IRecommender
predict
in interface IRecommender
predict
in class RatingPredictor
user_id
- the user IDitem_id
- the item ID
public void addRating(int user_id, int item_id, double rating)
IIncrementalRatingPredictor
addRating
in interface IIncrementalRatingPredictor
addRating
in class IncrementalRatingPredictor
user_id
- the ID of the user who performed the ratingitem_id
- the ID of the rated itemrating
- the rating valuepublic void updateRating(int user_id, int item_id, double rating)
IIncrementalRatingPredictor
updateRating
in interface IIncrementalRatingPredictor
updateRating
in class IncrementalRatingPredictor
user_id
- the ID of the user who performed the ratingitem_id
- the ID of the rated itemrating
- the rating valuepublic void removeRating(int user_id, int item_id)
IIncrementalRatingPredictor
removeRating
in interface IIncrementalRatingPredictor
removeRating
in class IncrementalRatingPredictor
user_id
- the ID of the user who performed the ratingitem_id
- the ID of the rated itempublic void addItem(int item_id)
addItem
in class IncrementalRatingPredictor
public void removeItem(int item_id)
IIncrementalRatingPredictor
removeItem
in interface IIncrementalRatingPredictor
removeItem
in class IncrementalRatingPredictor
item_id
- the ID of the user to be removedpublic java.lang.String toString()
IRecommender
toString
in interface IRecommender
toString
in class RatingPredictor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |