org.mymedialite.itemrec
Class UserAttributeKNN

java.lang.Object
  extended by org.mymedialite.itemrec.ItemRecommender
      extended by org.mymedialite.itemrec.KNN
          extended by org.mymedialite.itemrec.UserKNN
              extended by 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.


Field Summary
 
Fields inherited from class org.mymedialite.itemrec.KNN
correlation, k, nearest_neighbors
 
Fields inherited from class org.mymedialite.itemrec.ItemRecommender
feedback, maxItemID, maxUserID
 
Constructor Summary
UserAttributeKNN()
           
 
Method Summary
 SparseBooleanMatrix getUserAttributes()
          Getter for binary user attributes
 int numUserAttributes()
          Getter for number of binary user attributes
 void setUserAttributes(SparseBooleanMatrix userAttributes)
          Setter for binary user attributes
 java.lang.String toString()
          Return a string representation of the recommender
 void train()
          Learn the model parameters of the recommender from the training data
 
Methods inherited from class org.mymedialite.itemrec.UserKNN
getMostSimilarUsers, getUserSimilarity, predict
 
Methods inherited from class org.mymedialite.itemrec.KNN
loadModel, loadModel, saveModel, saveModel
 
Methods inherited from class org.mymedialite.itemrec.ItemRecommender
canPredict, clone, getFeedback, setFeedback
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mymedialite.IRecommender
canPredict, loadModel, predict, saveModel
 

Constructor Detail

UserAttributeKNN

public UserAttributeKNN()
Method Detail

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.