|
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.HortingAlgorithm
Describes an implementation of the CFAlgorithm interface to make CF predictions using the graph-theoretic algorithm described by Aggarwal, et al based on notions of horting and predictability.
Field Summary | |
(package private) long |
hortTime
Keep track of total time spent horting and predicting |
(package private) long |
predictTime
|
Constructor Summary | |
HortingAlgorithm(DataManager dataMgr)
Constructor, when neighborLists unavailable |
|
HortingAlgorithm(DataManager dataMgr,
java.util.ArrayList neighborLists)
Constructor with neighborLists available |
Method Summary | |
long |
getAveragePredictionTime()
Get average prediction time. |
java.util.ArrayList |
getNeighborLists()
Return neighborLists |
ItemPrediction[] |
getRecommendations(int activeUser,
int n)
Returns top n recommendations. |
ItemPrediction[] |
getRecommendationsByType(int activeUser,
int n,
int type)
Yun Wang Return top n recommendations of specific type. |
ItemPrediction |
predictRating(int userID,
int itemID)
Get predicted rating for a user's item |
java.lang.String |
toString()
Return the name of this algorithm |
void |
updateUser(int userID)
When new user comes in, update the neighborLists and maxUser and HortingArray. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
long hortTime
long predictTime
Constructor Detail |
public HortingAlgorithm(DataManager dataMgr)
dataMgr
- public HortingAlgorithm(DataManager dataMgr, java.util.ArrayList neighborLists)
dataMgr
- neighborLists
- Method Detail |
public java.util.ArrayList getNeighborLists()
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[] 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 java.lang.String toString()
toString
in interface CFAlgorithm
toString
in class java.lang.Object
public void updateUser(int userID) throws CFNotImplementedException
updateUser
in interface CFAlgorithm
userID
-
CFNotImplementedException
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |