org.mymedialite.ratingprediction
Class ItemAttributeKNN
java.lang.Object
org.mymedialite.ratingprediction.RatingPredictor
org.mymedialite.ratingprediction.IncrementalRatingPredictor
org.mymedialite.ratingprediction.KNN
org.mymedialite.ratingprediction.ItemKNN
org.mymedialite.ratingprediction.ItemAttributeKNN
- All Implemented Interfaces:
- java.lang.Cloneable, IItemAttributeAwareRecommender, IItemSimilarityProvider, IRecommender, IIncrementalRatingPredictor, IRatingPredictor
public class ItemAttributeKNN
- extends ItemKNN
- implements IItemAttributeAwareRecommender
Attribute-aware weighted item-based kNN recommender.
This recommender does NOT support incremental updates.
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ItemAttributeKNN
public ItemAttributeKNN()
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 matrix)
- Description copied from interface:
IItemAttributeAwareRecommender
- Setter for binary item attributes
- Specified by:
setItemAttributes
in interface IItemAttributeAwareRecommender
retrainItem
protected void retrainItem(int item_id)
- Description copied from class:
ItemKNN
- Retrain model for a given item.
- Specified by:
retrainItem
in class ItemKNN
- Parameters:
item_id
- the item ID
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
- Specified by:
train
in class RatingPredictor
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 RatingPredictor
- Returns:
- the class name and all hyperparameters, separated by space characters.