C# Class MyMediaLite.ItemRecommendation.BPR_Linear

Linear model optimized for BPR
This recommender does NOT support incremental updates.
Inheritance: ItemRecommender, IItemAttributeAwareRecommender, IIterativeModel
Exibir arquivo Open project: zenogantner/MML-KDD

Protected Properties

Property Type Description
iteration_length int

Public Methods

Method Description
ComputeFit ( ) : double
Iterate ( ) : void

Perform one iteration of stochastic gradient ascent over the training data. One iteration is iteration_length * number of entries in the training matrix

LoadModel ( string filename ) : void
Predict ( int user_id, int item_id ) : double
SaveModel ( string filename ) : void
ToString ( ) : string
Train ( ) : void

Protected Methods

Method Description
SampleItemPair ( int u, int &i, int &j ) : void

Sample a pair of items, given a user

SampleTriple ( int &u, int &i, int &j ) : void

Sample a triple for BPR learning

SampleUser ( ) : int

Sample a user that has viewed at least one and not all items

UpdateFeatures ( int u, int i, int j ) : void

Modified feature update method that exploits attribute sparsity

Method Details

ComputeFit() public method

public ComputeFit ( ) : double
return double

Iterate() public method

Perform one iteration of stochastic gradient ascent over the training data. One iteration is iteration_length * number of entries in the training matrix
public Iterate ( ) : void
return void

LoadModel() public method

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

Predict() public method

public Predict ( int user_id, int item_id ) : double
user_id int
item_id int
return double

SampleItemPair() protected method

Sample a pair of items, given a user
protected SampleItemPair ( int u, int &i, int &j ) : void
u int the user ID
i int the ID of the first item
j int the ID of the second item
return void

SampleTriple() protected method

Sample a triple for BPR learning
protected SampleTriple ( int &u, int &i, int &j ) : void
u int the user ID
i int the ID of the first item
j int the ID of the second item
return void

SampleUser() protected method

Sample a user that has viewed at least one and not all items
protected SampleUser ( ) : int
return int

SaveModel() public method

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

ToString() public method

public ToString ( ) : string
return string

Train() public method

public Train ( ) : void
return void

UpdateFeatures() protected method

Modified feature update method that exploits attribute sparsity
protected UpdateFeatures ( int u, int i, int j ) : void
u int
i int
j int
return void

Property Details

iteration_length protected_oe property

One iteration is iteration_length * number of entries in the training matrix
protected int iteration_length
return int