org.mymedialite.itemrec
Class UserAttributeKNN
java.lang.Object
org.mymedialite.itemrec.ItemRecommender
org.mymedialite.itemrec.KNN
org.mymedialite.itemrec.UserKNN
org.mymedialite.itemrec.UserAttributeKNN
- All Implemented Interfaces:
- java.lang.Cloneable, IRecommender, IUserAttributeAwareRecommender, IUserSimilarityProvider
public class UserAttributeKNN
- extends UserKNN
- implements IUserAttributeAwareRecommender
k-nearest neighbor user-based collaborative filtering using cosine-similarity over the user attibutes.
This recommender does NOT support incremental updates.
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UserAttributeKNN
public UserAttributeKNN()
getUserAttributes
public SparseBooleanMatrix getUserAttributes()
- Description copied from interface:
IUserAttributeAwareRecommender
- Getter for binary user attributes
- Specified by:
getUserAttributes
in interface IUserAttributeAwareRecommender
setUserAttributes
public void setUserAttributes(SparseBooleanMatrix userAttributes)
- Description copied from interface:
IUserAttributeAwareRecommender
- Setter for binary user attributes
- Specified by:
setUserAttributes
in interface IUserAttributeAwareRecommender
numUserAttributes
public int numUserAttributes()
- Description copied from interface:
IUserAttributeAwareRecommender
- Getter for number of binary user attributes
- Specified by:
numUserAttributes
in interface IUserAttributeAwareRecommender
train
public void train()
- Description copied from interface:
IRecommender
- Learn the model parameters of the recommender from the training data
- Specified by:
train
in interface IRecommender
- Overrides:
train
in class UserKNN
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 UserKNN
- Returns:
- the class name and all hyperparameters, separated by space characters.