|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.algorithms.SimplePearsonAlgorithm
Describes an implementation of the CFAlgorithm interface to make CF predictions using the Simple Pearson Correlation method.
Constructor Summary | |
SimplePearsonAlgorithm(DataManager dataMgr)
Constructor, pass in dataMgr and initialize algorithm parameters. |
Method Summary | |
long |
getAveragePredictionTime()
Return average prediction time. |
ItemPrediction[] |
getRecommendations(int activeUser,
int n)
Return top n recommendations. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Yun Wang Return top n recommendations of specific type. |
SimilarityWeight |
getWeight(RatingArrays activeUserRatings,
int neighbor,
int itemId)
Calculate CorrelationCoeff for an item between the activeuser and one neighbor. |
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)
Doesn't currently need upateUser. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SimplePearsonAlgorithm(DataManager 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 long getAveragePredictionTime() throws CFNotImplementedException
getAveragePredictionTime
in interface CFAlgorithm
CFNotImplementedException
public SimilarityWeight getWeight(RatingArrays activeUserRatings, int neighbor, int itemId)
neighbor
- itemId
-
public void updateUser(int userID) throws CFNotImplementedException
updateUser
in interface CFAlgorithm
userID
-
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 |