class_docstr: Probabilistic Matrix Factorization.
  
  Parameters
  ----------
  k: int, optional, default: 5
      The dimension of the latent factors.
  
  max_iter: int, optional, default: 100
      Maximum number of iterations or the number of epochs for SGD.
  
  learning_rate: float, optional, default: 0.001
      The learning rate for SGD_RMSProp.
      
  gamma: float, optional, default: 0.9
      The weight for previous/current gradient in RMSProp.
  
  lambda_reg: float, optional, default: 0.001
      The regularization coefficient.
  
  name: string, optional, default: 'PMF'
      The name of the recommender model.
      
  variant: {"linear","non_linear"}, optional, default: 'non_linear'
      Pmf variant. If 'non_linear', the Gaussian mean is the output of a Sigmoid function.        If 'linear' the Gaussian mean is the output of the identity function.
  
  trainable: boolean, optional, default: True
      When False, the model is not trained and Cornac assumes that the model already         pre-trained (U and V are not None).
      
  verbose: boolean, optional, default: False
      When True, some running logs are displayed.
  
  init_params: dict, optional, default: None
      List of initial parameters, e.g., init_params = {'U':U, 'V':V}.
      
      U: ndarray, shape (n_users, k) 
          User latent factors.
      
      V: ndarray, shape (n_items, k)
          Item latent factors.
  
  seed: int, optional, default: None
      Random seed for parameters initialization.
  
  References
  ----------
  * Mnih, Andriy, and Ruslan R. Salakhutdinov. Probabilistic matrix factorization.     In NIPS, pp. 1257-1264. 2008.
class_docstr_tok: ["Probabilistic","Matrix","Factorization",".","Parameters","--","--","--","--","--","k",":","int",",","optional",",","default",":","5","The","dimension","of","the","latent","factors",".","max_iter",":","int",",","optional",",","default",":","100","Maximum","number","of","iterations","or","the","number","of","epochs","for","SGD",".","learning_rate",":","float",",","optional",",","default",":","0.001","The","learning","rate","for","SGD_RMSProp",".","gamma",":","float",",","optional",",","default",":","0.9","The","weight","for","previous\/current","gradient","in","RMSProp",".","lambda_reg",":","float",",","optional",",","default",":","0.001","The","regularization","coefficient",".","name",":","string",",","optional",",","default",":","'PMF'","The","name","of","the","recommender","model",".","variant",":","{","``","linear","''",",","''","non_linear","''","}",",","optional",",","default",":","'non_linear'","Pmf","variant",".","If","'non_linear","'",",","the","Gaussian","mean","is","the","output","of","a","Sigmoid","function",".","If","'linear","'","the","Gaussian","mean","is","the","output","of","the","identity","function",".","trainable",":","boolean",",","optional",",","default",":","True","When","False",",","the","model","is","not","trained","and","Cornac","assumes","that","the","model","already","pre-trained","(","U","and","V","are","not","None",")",".","verbose",":","boolean",",","optional",",","default",":","False","When","True",",","some","running","logs","are","displayed",".","init_params",":","dict",",","optional",",","default",":","None","List","of","initial","parameters",",","e.g.",",","init_params","=","{","'","U","'",":","U",",","'","V","'",":","V","}",".","U",":","ndarray",",","shape","(","n_users",",","k",")","User","latent","factors",".","V",":","ndarray",",","shape","(","n_items",",","k",")","Item","latent","factors",".","seed",":","int",",","optional",",","default",":","None","Random","seed","for","parameters","initialization",".","References","--","--","--","--","--","*","Mnih",",","Andriy",",","and","Ruslan","R.","Salakhutdinov",".","Probabilistic","matrix","factorization",".","In","NIPS",",","pp",".","1257-1264",".","2008","."]
code: def __init__(
      self,
      k=5,
      max_iter=100,
      learning_rate=0.001,
      gamma=0.9,
      lambda_reg=0.001,
      name="PMF",
      variant="non_linear",
      trainable=True,
      verbose=False,
      init_params=None,
      seed=None,
  ):
      Recommender.__init__(
          self, name=name, trainable=trainable, verbose=verbose
      )
      self.k = k
      self.max_iter = max_iter
      self.learning_rate = learning_rate
      self.gamma = gamma
      self.lambda_reg = lambda_reg
      self.variant = variant
      self.seed = seed
  
      self.ll = np.full(max_iter, 0)
      self.eps = 0.000000001
  
      # Init params if provided
      self.init_params = {} if init_params is None else init_params
      self.U = self.init_params.get("U", None)  # matrix of user factors
      self.V = self.init_params.get("V", None)
  
file_path: cornac/cornac/models/pmf/recom_pmf.py
imports: import numpy
  from ..recommender import Recommender
  from ..recommender import ANNMixin, MEASURE_DOT
  from ...utils.common import sigmoid
  from ...utils.common import scale
  from ...exception import ScoreException
label_desc: Use image node_id 1 to create a new PMF object from inherited base classes: Recommender, ANNMixin with example: obj = PMF(k, max_iter, learning_rate, gamma, lambda_reg, name, variant, trainable, verbose, init_params, seed)