|
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.SimpleDistributionAlgorithm
Describes an implementation of the CFAlgorithm interface to make CF predictions using the Simple Pearson Correlation combined with distribtion vectors.
Field Summary | |
(package private) int |
formula
Variables declaring how the algorithm will run |
(package private) int |
predictionStyle
|
Constructor Summary | |
SimpleDistributionAlgorithm(DataManager dataMgr)
Constructor, pass in dataMgr and initialize algorithm parameters. |
Method Summary | |
ItemPrediction |
computeRating(float[] activeDist,
float[] difDist,
float activeMean,
int itemNumber)
Return the computed prediction |
float[] |
getActiveUserDist(int activeuser)
Return the DistributionArray of the active user |
long |
getAveragePredictionTime()
Return average prediction time. |
float[] |
getItemDist(int item)
Return the DistributionArray of the active user |
ItemPrediction[] |
getRecommendations(int activeUser,
int n)
Return top n recommendations. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Return top n recommendations of specific type. |
SimilarityWeight |
getWeight(int activeuser,
int neighbor,
int itemId)
Calculate CorrelatinCoeff for an item between the activeuser and one neighbor. |
float[] |
mapDist(float[] ActiveUserDist,
float[] DifDist,
float ActiveAverage)
Return the return the sum/Mapping of the ActiveDistribution and the DifDistribution |
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. |
int |
transfer_to_index(float difference)
Return the return the mapped index of the relativeDifDist |
void |
updateUser(int userID)
Haven't been implemented. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
int formula
int predictionStyle
Constructor Detail |
public SimpleDistributionAlgorithm(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(int activeuser, int neighbor, int itemId)
activeuser
- 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
public float[] mapDist(float[] ActiveUserDist, float[] DifDist, float ActiveAverage)
ActiveUserDist
- DifDist
-
public int transfer_to_index(float difference)
difference
-
public float[] getActiveUserDist(int activeuser)
public float[] getItemDist(int item)
public ItemPrediction computeRating(float[] activeDist, float[] difDist, float activeMean, int itemNumber)
difDist
-
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |