|
|||||||||
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
public abstract class EntityAverage
Abstract class that uses an average (by entity) rating value for predictions. This engine does NOT support online updates.
Field Summary | |
---|---|
protected DoubleList |
entity_averages
The average rating for each entity |
protected double |
global_average
The global average rating (default prediction if there is no data about an entity) |
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 | |
---|---|
EntityAverage()
|
Method Summary | |
---|---|
double |
get(int index)
Return the average rating for a given entity |
void |
loadModel(java.lang.String filename)
Get the model parameters from a file |
protected void |
retrain(int entity_id,
IntList indices,
IntList entity_ids)
Retrain the recommender according to the given entity type. |
void |
saveModel(java.lang.String filename)
Save the model parameters to a file |
protected void |
train(IntList entity_ids,
int max_entity_id)
Train the recommender according to the given entity type |
Methods inherited from class org.mymedialite.ratingprediction.IncrementalRatingPredictor |
---|
addItem, addRating, addUser, getUpdateItems, getUpdateUsers, removeItem, removeRating, removeUser, setUpdateItems, setUpdateUsers, updateRating |
Methods inherited from class org.mymedialite.ratingprediction.RatingPredictor |
---|
canPredict, clone, getMaxRating, getMinRating, getRatings, predict, 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, predict, toString, train |
Field Detail |
---|
protected DoubleList entity_averages
protected double global_average
Constructor Detail |
---|
public EntityAverage()
Method Detail |
---|
public double get(int index)
index
- the entity indexprotected void train(IntList entity_ids, int max_entity_id)
entity_ids
- a list of the relevant entity IDs in the training datamax_entity_id
- the maximum entity IDprotected void retrain(int entity_id, IntList indices, IntList entity_ids)
entity_id
- the ID of the entity to updateindices
- list of indices to use for retrainingentity_ids
- list of all entity IDs in the training data (per rating)public void saveModel(java.lang.String filename) throws java.io.IOException
IRecommender
saveModel
in interface IRecommender
saveModel
in class RatingPredictor
filename
- the file to write to
java.io.IOException
public void loadModel(java.lang.String filename) throws java.io.IOException
IRecommender
loadModel
in interface IRecommender
loadModel
in class RatingPredictor
filename
- the file to read from
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |