|
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.TransNeighborAlgorithm
Implementation of a transitive nearest-neighbor CF algorithm. Find neighbors using Pearson correlation. If none of our neighbors have rated a given item, try our neighbors' neighbors.
Constructor Summary | |
TransNeighborAlgorithm(DataManager dataMgr)
Constructor, initialize algorithm parameters. |
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)
Not yet complete |
SimilarityWeight |
getWeight(int activeUser,
int neighbor)
Compute a correlation between activeUser and one neighbor. |
void |
linkToPredictors(int userID)
Link to predictors. |
ItemPrediction |
predictRating(int activeUser,
int item)
predicts the rating for the given user and item. |
java.lang.String |
toString()
Returns a simple text identifier for 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 TransNeighborAlgorithm(DataManager dataMgr)
dataMgr
- Method Detail |
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[] getRecommendations(int activeUser, int n) throws java.sql.SQLException, CFNotImplementedException
getRecommendations
in interface CFAlgorithm
activeUser
- n
-
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 SimilarityWeight getWeight(int activeUser, int neighbor)
activeUser
- neighbor
-
public void linkToPredictors(int userID)
userID
- 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 |