org.mymedialite.itemrec
Class ItemAttributeKNN

java.lang.Object
  extended by org.mymedialite.itemrec.ItemRecommender
      extended by org.mymedialite.itemrec.KNN
          extended by org.mymedialite.itemrec.ItemKNN
              extended by org.mymedialite.itemrec.ItemAttributeKNN
All Implemented Interfaces:
java.lang.Cloneable, IItemAttributeAwareRecommender, IItemSimilarityProvider, IRecommender
Direct Known Subclasses:
WeightedItemAttributeKNN, WeightedItemHierarchicalAttributeKNN

public class ItemAttributeKNN
extends ItemKNN
implements IItemAttributeAwareRecommender

k-nearest neighbor item-based collaborative filtering using cosine-similarity over the item 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
ItemAttributeKNN()
           
 
Method Summary
 SparseBooleanMatrix getItemAttributes()
          Getter for binary item attributes
 int numItemAttributes()
          Getter for number of binary item attributes
 void setItemAttributes(SparseBooleanMatrix itemAttributes)
          Setter for binary item 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.ItemKNN
getItemSimilarity, getMostSimilarItems, 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

ItemAttributeKNN

public ItemAttributeKNN()
Method Detail

getItemAttributes

public SparseBooleanMatrix getItemAttributes()
Description copied from interface: IItemAttributeAwareRecommender
Getter for binary item attributes

Specified by:
getItemAttributes in interface IItemAttributeAwareRecommender

setItemAttributes

public void setItemAttributes(SparseBooleanMatrix itemAttributes)
Description copied from interface: IItemAttributeAwareRecommender
Setter for binary item attributes

Specified by:
setItemAttributes in interface IItemAttributeAwareRecommender

numItemAttributes

public int numItemAttributes()
Description copied from interface: IItemAttributeAwareRecommender
Getter for number of binary item attributes

Specified by:
numItemAttributes in interface IItemAttributeAwareRecommender

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 ItemKNN

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 ItemKNN
Returns:
the class name and all hyperparameters, separated by space characters.