|
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.UserItem2Algorithm
Describes an implementation of the CFAlgorithm interface to make CF predictions using a Pearson nearest neighbor algorithm, but limited to examining similar items using the Item-Item adjusted cosine algorithm described in Sarwar, et al, 2001. Item similarities are precomputed. Then, to make an individual prediction for a user and an item, we select the N items rated by the user most similar to the item we're predicting. This subset of the user's ratings is used for correlations, which in turn yield a list of neighbors for.
Field Summary | |
(package private) java.util.List[] |
neighborLists
|
Constructor Summary | |
UserItem2Algorithm(DataManager dataMgr)
Constructor, load parameters and set up neighborhoods. |
Method Summary | |
long |
getAveragePredictionTime()
Very useful to get the prediction time after a bunch of experiment Should be implemented within each algorithm class. |
ItemRating[] |
getRecommendations(int activeUser,
int n)
Not yet implemented. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Not yet complete |
ItemPrediction |
predictRating(int activeUser,
int item)
predicts the rating for the given user and item |
(package private) void |
setUpNeighborhoods()
Set up neighborhoods. |
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 |
Field Detail |
java.util.List[] neighborLists
Constructor Detail |
public UserItem2Algorithm(DataManager dataMgr)
Method Detail |
void setUpNeighborhoods()
public ItemRating[] getRecommendations(int activeUser, int n) throws java.sql.SQLException, CFNotImplementedException
getRecommendations
in interface CFAlgorithm
activeUser
- n
-
java.sql.SQLException
CFNotImplementedException
public ItemPrediction[] getRecommendationsByType(int activeUser, int n, int type) throws java.sql.SQLException, CFNotImplementedException
getRecommendationsByType
in interface CFAlgorithm
activeUser
- n
- type
-
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
CFAlgorithm
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 |