C# Class MyMediaLite.RatingPrediction.ItemKNN

Weighted item-based kNN
Inheritance: KNN, IItemSimilarityProvider, IFoldInRatingPredictor
ファイルを表示 Open project: zenogantner/MML-KDD

Protected Properties

Property Type Description
GetPositivelyCorrelatedEntities IList>.Func
data_item MyMediaLite.DataType.SparseBooleanMatrix

Public Methods

Method Description
AddRating ( int user_id, int item_id, double rating ) : void
ItemKNN ( ) : System
LoadModel ( string filename ) : void
Predict ( int user_id, int item_id ) : double

Predict the rating of a given user for a given item

If the user or the item are not known to the recommender, a suitable average is returned. To avoid this behavior for unknown entities, use CanPredict() to check before.

RemoveRating ( int user_id, int item_id ) : void
UpdateRating ( int user_id, int item_id, double rating ) : void

Protected Methods

Method Description
AddItem ( int item_id ) : void

Method Details

AddItem() protected method

protected AddItem ( int item_id ) : void
item_id int
return void

AddRating() public method

public AddRating ( int user_id, int item_id, double rating ) : void
user_id int
item_id int
rating double
return void

ItemKNN() public method

public ItemKNN ( ) : System
return System

LoadModel() public method

public LoadModel ( string filename ) : void
filename string
return void

Predict() public method

Predict the rating of a given user for a given item
If the user or the item are not known to the recommender, a suitable average is returned. To avoid this behavior for unknown entities, use CanPredict() to check before.
public Predict ( int user_id, int item_id ) : double
user_id int the user ID
item_id int the item ID
return double

RemoveRating() public method

public RemoveRating ( int user_id, int item_id ) : void
user_id int
item_id int
return void

UpdateRating() public method

public UpdateRating ( int user_id, int item_id, double rating ) : void
user_id int
item_id int
rating double
return void

Property Details

GetPositivelyCorrelatedEntities protected_oe property

Get positively correlated entities
protected Func> GetPositivelyCorrelatedEntities
return IList>.Func

data_item protected_oe property

Matrix indicating which item was rated by which user
protected SparseBooleanMatrix,MyMediaLite.DataType data_item
return MyMediaLite.DataType.SparseBooleanMatrix