|
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.ClusteringAlgorithm
Collaborative filtering algorithm using Bayesian clustering, to divide users into different "classes," and recommend items based on membership in these classes.
Field Summary | |
(package private) float[] |
classPriors
|
(package private) DataManager |
dataMgr
|
(package private) static float |
GRADIENT_RATIO
|
(package private) int |
maxClass
|
(package private) int |
maxItem
|
(package private) int |
maxRating
|
(package private) boolean |
USE_EXPECTED_VALUE
|
(package private) float[][][] |
wArray
|
Constructor Summary | |
ClusteringAlgorithm(DataManager dataMgr)
Constructor, initialize DataManager, parameters and wArray. |
Method Summary | |
(package private) float[] |
calcAllProbs(java.util.Iterator evidence)
Calculate all probabilities. |
long |
getAveragePredictionTime()
Return average prediction time |
ItemPrediction[] |
getRecommendations(int activeUser,
int n)
Not yet implemented. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Haven't been implemented yet. |
(package private) float |
gradientAscentStep()
Do one step of gradient ascent to refine the values in wArray |
void |
initRandomArray(int numClasses)
Create the wArray and fill it with random values. |
(package private) void |
normalizeArray()
Normalize wArray so that the probabilities for each rating on an item sum to 1. |
ItemPrediction |
predictRating(int userID,
int itemID)
Asks the prediction engine to return a prediction for how a particular user will rate a particular 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 |
DataManager dataMgr
float[][][] wArray
float[] classPriors
int maxClass
int maxItem
int maxRating
static final float GRADIENT_RATIO
boolean USE_EXPECTED_VALUE
Constructor Detail |
public ClusteringAlgorithm(DataManager dataMgr)
dataMgr
- Method Detail |
public void initRandomArray(int numClasses)
numClasses
- float gradientAscentStep()
void normalizeArray()
float[] calcAllProbs(java.util.Iterator evidence)
evidence
- - Iterator over evidence
public ItemPrediction predictRating(int userID, int itemID) throws CFNotImplementedException
predictRating
in interface CFAlgorithm
userID
- itemID
-
CFNotImplementedException
public long getAveragePredictionTime() throws CFNotImplementedException
getAveragePredictionTime
in interface CFAlgorithm
CFNotImplementedException
public ItemPrediction[] getRecommendations(int activeUser, int n) throws java.sql.SQLException, CFNotImplementedException
getRecommendations
in interface CFAlgorithm
activeUser
- n
-
java.sql.SQLException
CFNotImplementedException
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 ItemPrediction[] getRecommendationsByType(int activeUser, int n, int type) throws java.sql.SQLException, CFNotImplementedException
getRecommendationsByType
in interface CFAlgorithm
activeUser
- n
- type
-
java.sql.SQLException
CFNotImplementedException
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |