org.mymedialite.itemrec
Class WeightedItemAttributeKNN
java.lang.Object
org.mymedialite.itemrec.ItemRecommender
org.mymedialite.itemrec.KNN
org.mymedialite.itemrec.ItemKNN
org.mymedialite.itemrec.ItemAttributeKNN
org.mymedialite.itemrec.WeightedItemAttributeKNN
- All Implemented Interfaces:
- java.lang.Cloneable, IItemAttributeAwareRecommender, IItemSimilarityProvider, IRecommender
public class WeightedItemAttributeKNN
- extends ItemAttributeKNN
Weighted k-nearest neighbor item-based collaborative filtering using cosine-similarity
over the item attibutes.
This recommender does NOT support incremental updates.
Method Summary |
double |
predict(int user_id,
int item_id)
Predict the rating or score for a given user-item combination. |
java.lang.String |
toString()
Return a string representation of the recommender |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
WeightedItemAttributeKNN
public WeightedItemAttributeKNN()
predict
public double predict(int user_id,
int item_id)
- Description copied from interface:
IRecommender
- Predict the rating or score for a given user-item combination.
- Specified by:
predict
in interface IRecommender
- Overrides:
predict
in class ItemKNN
- Parameters:
user_id
- the user IDitem_id
- the item ID
- Returns:
- the predicted score/rating for the given user-item combination
toString
public java.lang.String toString()
- Description copied from interface:
IRecommender
- Return a string representation of the recommender
- Specified by:
toString
in interface IRecommender
- Overrides:
toString
in class ItemAttributeKNN
- Returns:
- the class name and all hyperparameters, separated by space characters.