|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.algorithms.Experimental.PopAlgorithm
Describes an implementation of the CFAlgorithm interface to make CF predictions using the non-personalized prediction algorithm described by Herlocker, et al 1999. Summary of algorithm: Compares all users rating for the item with their average ratings, and computes and average offset for this item. Returns the active user's mean rating plus this average offset. This turns out to be much more effective than a simple average over all user ratings for the item, since it takes into account different rating scales for different users.
Constructor Summary | |
PopAlgorithm(DataManager mgr)
Constructor, simply assigns DataManager. |
Method Summary | |
long |
getAveragePredictionTime()
Return average prediction time. |
ItemPrediction[] |
getRecommendations(int activeUser,
int n)
Returns top n recommendations. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Yun Wang Return top n recommendations of specific type. |
ItemPrediction |
predictRating(int activeUser,
int item)
Predicts the rating for the given user and item. |
java.lang.String |
toString()
Return the name of this algorithm. |
void |
updateUser(int userID)
Not yet implemented. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PopAlgorithm(DataManager mgr)
mgr
- Method Detail |
public ItemPrediction[] getRecommendationsByType(int activeUser, int n, int type) throws CFNotImplementedException, java.sql.SQLException
getRecommendationsByType
in interface CFAlgorithm
activeUser
- n
- type
-
java.sql.SQLException
CFNotImplementedException
public ItemPrediction[] getRecommendations(int activeUser, int n) throws java.sql.SQLException, CFNotImplementedException
getRecommendations
in interface CFAlgorithm
activeUser
- user to predict forn
- number of recommendations to acquire
java.sql.SQLException
CFNotImplementedException
public ItemPrediction predictRating(int activeUser, int item) throws CFNotImplementedException
predictRating
in interface CFAlgorithm
activeUser
- item
-
CFNotImplementedException
public void updateUser(int userID) throws CFNotImplementedException
updateUser
in interface CFAlgorithm
userID
-
CFNotImplementedException
public long getAveragePredictionTime() throws CFNotImplementedException
getAveragePredictionTime
in interface CFAlgorithm
CFNotImplementedException
public java.lang.String toString()
toString
in interface CFAlgorithm
toString
in class java.lang.Object
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |