org.mymedialite.ratingprediction
Interface IIncrementalRatingPredictor

All Superinterfaces:
java.lang.Cloneable, IRatingPredictor, IRecommender
All Known Implementing Classes:
BiasedMatrixFactorization, Constant, EntityAverage, GlobalAverage, IncrementalRatingPredictor, ItemAttributeKNN, ItemAverage, ItemKNN, ItemKNNCosine, ItemKNNPearson, KNN, LogisticRegressionMatrixFactorization, MatrixFactorization, SocialMF, UserAttributeKNN, UserAverage, UserItemBaseline, UserKNN, UserKNNCosine, UserKNNPearson

public interface IIncrementalRatingPredictor
extends IRatingPredictor

Interface for rating predictors which support incremental training


Method Summary
 void addRating(int userId, int itemId, double rating)
          Add a new rating and perform incremental training
 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 interface org.mymedialite.ratingprediction.IRatingPredictor
getMaxRating, getMinRating, setMaxRating, setMinRating
 
Methods inherited from interface org.mymedialite.IRecommender
canPredict, loadModel, predict, saveModel, toString, train
 

Method Detail

addRating

void addRating(int userId,
               int itemId,
               double rating)
Add a new rating and perform incremental training

Parameters:
userId - the ID of the user who performed the rating
itemId - the ID of the rated item
rating - the rating value

updateRating

void updateRating(int userId,
                  int itemId,
                  double rating)
                  throws java.lang.IllegalArgumentException
Update an existing rating and perform incremental training

Parameters:
userId - the ID of the user who performed the rating
itemId - the ID of the rated item
rating - the rating value
Throws:
java.lang.IllegalArgumentException

removeRating

void removeRating(int userId,
                  int itemId)
Remove an existing rating and perform "incremental" training

Parameters:
userId - the ID of the user who performed the rating
itemId - the ID of the rated item

removeUser

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.

Parameters:
userId - the ID of the user to be removed

removeItem

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.

Parameters:
itemId - the ID of the user to be removed

getUpdateUsers

boolean getUpdateUsers()
true if users shall be updated when doing incremental updates.


setUpdateUsers

void setUpdateUsers(boolean updateUsers)
Set to true if users shall be updated when doing incremental updates. Set to false if you do not want any updates to the user model parameters when doing incremental updates. Default should be true.


getUpdateItems

boolean getUpdateItems()
true if items shall be updated when doing incremental updates.


setUpdateItems

void setUpdateItems(boolean updateItems)
Set to true if items shall be updated when doing incremental updates. Set to false if you do not want any updates to the item model parameters when doing incremental updates. Default should true.