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","."]
docstr: Predict the scores/ratings of a user for an item.
  
  Parameters
  ----------
  user_idx: int, required
      The index of the user for whom to perform score prediction.
  
  item_idx: int, optional, default: None
      The index of the item for which to perform score prediction.
      If None, scores for all known items will be returned.
  
  Returns
  -------
  res : A scalar or a Numpy array
      Relative scores that the user gives to the item or to all known items
docstr_tok: ["Predict","the","scores\/ratings","of","a","user","for","an","item",".","Parameters","--","--","--","--","--","user_idx",":","int",",","required","The","index","of","the","user","for","whom","to","perform","score","prediction",".","item_idx",":","int",",","optional",",","default",":","None","The","index","of","the","item","for","which","to","perform","score","prediction",".","If","None",",","scores","for","all","known","items","will","be","returned",".","Returns","--","--","--","-","res",":","A","scalar","or","a","Numpy","array","Relative","scores","that","the","user","gives","to","the","item","or","to","all","known","items"]
code: def score(self, user_idx, item_idx=None):
      """Predict the scores/ratings of a user for an item.
  
      Parameters
      ----------
      user_idx: int, required
          The index of the user for whom to perform score prediction.
  
      item_idx: int, optional, default: None
          The index of the item for which to perform score prediction.
          If None, scores for all known items will be returned.
  
      Returns
      -------
      res : A scalar or a Numpy array
          Relative scores that the user gives to the item or to all known items
  
      """
      if self.is_unknown_user(user_idx):
          raise ScoreException(
              "Can't make score prediction for user %d" % user_idx
          )
  
      if item_idx is not None and self.is_unknown_item(item_idx):
          raise ScoreException(
              "Can't make score prediction for item %d" % item_idx
          )
  
      if item_idx is None:
          return self.V.dot(self.U[user_idx, :])
  
      user_pred = self.V[item_idx, :].dot(self.U[user_idx, :])
      if self.variant == "non_linear":
          user_pred = sigmoid(user_pred)
          user_pred = scale(
              user_pred, self.min_rating, self.max_rating, 0.0, 1.0
          )
      return user_pred
  
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 3 for calling the PMF obj's underlying member method code with example usage: obj.score(user_idx, item_idx) and returns: user_pred, self