Property | Type | Description | |
---|---|---|---|
fast_sampling | bool | ||
fast_sampling_memory_limit | int | ||
item_bias | IList |
||
learn_rate | double | ||
random | |||
reg_i | double | ||
reg_j | double | ||
reg_u | double | ||
user_neg_items | IList |
||
user_pos_items | IList |
Method | Description | |
---|---|---|
AddFeedback ( int user_id, int item_id ) : void | ||
ComputeFit ( ) : double |
Compute the fit (AUC on training data)
|
|
ComputeLoss ( ) : double |
Compute approximate loss
|
|
Iterate ( ) : void |
Perform one iteration of stochastic gradient ascent over the training data One iteration is samples number of positive entries in the training matrix times |
|
LoadModel ( string file ) : void | ||
Predict ( int user_id, int item_id ) : double | ||
RemoveFeedback ( int user_id, int item_id ) : void | ||
RemoveItem ( int item_id ) : void | ||
RemoveUser ( int user_id ) : void | ||
SaveModel ( string file ) : void | ||
ToString ( ) : string | ||
Train ( ) : void |
Method | Description | |
---|---|---|
AddItem ( int item_id ) : void | ||
AddUser ( int user_id ) : void | ||
CheckSampling ( ) : void | ||
InitModel ( ) : void | ||
RetrainItem ( int item_id ) : void |
Retrain the latent factors of a given item
|
|
RetrainUser ( int user_id ) : void |
Retrain the latent factors of a given user
|
|
SampleItemPair ( int u, int &i, int &j ) : void |
Sample a pair of items, given a user
|
|
SampleOtherItem ( int u, int i, int &j ) : bool |
Sample another item, given the first one and the 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
|
|
UpdateFactors ( int u, int i, int j, bool update_u, bool update_i, bool update_j ) : void |
Update latent factors according to the stochastic gradient descent update rule
|
Method | Description | |
---|---|---|
CreateFastSamplingData ( int u ) : void |
public AddFeedback ( int user_id, int item_id ) : void | ||
user_id | int | |
item_id | int | |
return | void |
public Predict ( int user_id, int item_id ) : double | ||
user_id | int | |
item_id | int | |
return | double |
public RemoveFeedback ( int user_id, int item_id ) : void | ||
user_id | int | |
item_id | int | |
return | void |
protected RetrainItem ( int item_id ) : void | ||
item_id | int | the item ID |
return | void |
protected RetrainUser ( int user_id ) : void | ||
user_id | int | the user ID |
return | void |
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 |
protected SampleOtherItem ( int u, int i, int &j ) : bool | ||
u | int | the user ID |
i | int | the ID of the given item |
j | int | the ID of the other item |
return | bool |
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 |
protected UpdateFactors ( int u, int i, int j, bool update_u, bool update_i, bool update_j ) : void | ||
u | int | the user ID |
i | int | the ID of the first item |
j | int | the ID of the second item |
update_u | bool | if true, update the user latent factors |
update_i | bool | if true, update the latent factors of the first item |
update_j | bool | if true, update the latent factors of the second item |
return | void |
protected int fast_sampling_memory_limit | ||
return | int |