|
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.PersonalityAlgorithm
Describes an implementation of the CFAlgorithm interface to make CF predictions using the Personality Diagnosis algorithm described in Pennock et al, 1999.
Field Summary | |
(package private) int |
lastUser
|
(package private) float[][] |
probTable
|
(package private) java.util.List |
similarityWeightList
|
Constructor Summary | |
PersonalityAlgorithm(DataManager dataMgr)
Constructor, initialize algorithm parameters and DataManager. |
Method Summary | |
long |
getAveragePredictionTime()
Return average prediction time. |
ItemPrediction[] |
getRecommendations(int activeUser,
int n)
Not yet implemented. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Not yet complete |
SimilarityWeight |
getWeight(int activeuser,
int neighbor)
Calculate relative probability that the activeuser is of the same personality type as the neighbor. |
protected float |
noiseProb(float r1,
float r2)
Find the probability that an observed rating of r1 corresponds to the "true" rating of r2, assuming that observed ratings differ from "true" ratings by adding Gaussian noise. |
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 |
Field Detail |
float[][] probTable
int lastUser
java.util.List similarityWeightList
Constructor Detail |
public PersonalityAlgorithm(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 long getAveragePredictionTime()
getAveragePredictionTime
in interface CFAlgorithm
protected float noiseProb(float r1, float r2)
r1
- observed ratingr2
- hypothesized "true" rating
public SimilarityWeight getWeight(int activeuser, int neighbor)
activeuser
- neighbor
-
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 |