public code v1
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import implicit
|
||||
|
||||
from .mf_implicit_model import MFImplicitModel
|
||||
|
||||
|
||||
class BPR(MFImplicitModel):
|
||||
""""""
|
||||
def __init__(self,
|
||||
latent_dim,
|
||||
reg_term,
|
||||
learning_rate,
|
||||
epochs,
|
||||
**kwargs):
|
||||
|
||||
super(BPR, self).__init__(latent_dim=latent_dim,
|
||||
reg_term=reg_term,
|
||||
learning_rate=learning_rate,
|
||||
epochs=epochs)
|
||||
|
||||
self.model = implicit.bpr.BayesianPersonalizedRanking(
|
||||
factors=self.latent_dim,
|
||||
learning_rate=self.learning_rate,
|
||||
regularization=self.reg_term,
|
||||
iterations=self.epochs
|
||||
)
|
||||
Reference in New Issue
Block a user