class_docstr: Collaborative Ordinal Embedding.
  
  Parameters
  ----------
  k: int, optional, default: 20
      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.05
      The learning rate for SGD.
  
  lamda: float, optional, default: 0.001
      The regularization parameter.
  
  batch_size: int, optional, default: 100
      The batch size for SGD.
  
  name: string, optional, default: 'IBRP'
      The name of the recommender model.
  
  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: dictionary, optional, default: None
      List of initial parameters, e.g., init_params = {'U':U, 'V':V}.
  
      U: ndarray, shape (n_users, k)
          The user latent factors.
  
      V: ndarray, shape (n_items, k)
          The item latent factors.
  
  References
  ----------
  * Le, D. D., & Lauw, H. W. (2016, June). Euclidean co-embedding of ordinal data for multi-type visualization.     In Proceedings of the 2016 SIAM International Conference on Data Mining (pp. 396-404). Society for Industrial and Applied Mathematics.
class_docstr_tok: ["Collaborative","Ordinal","Embedding",".","Parameters","--","--","--","--","--","k",":","int",",","optional",",","default",":","20","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.05","The","learning","rate","for","SGD",".","lamda",":","float",",","optional",",","default",":","0.001","The","regularization","parameter",".","batch_size",":","int",",","optional",",","default",":","100","The","batch","size","for","SGD",".","name",":","string",",","optional",",","default",":","'IBRP'","The","name","of","the","recommender","model",".","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",":","dictionary",",","optional",",","default",":","None","List","of","initial","parameters",",","e.g.",",","init_params","=","{","'","U","'",":","U",",","'","V","'",":","V","}",".","U",":","ndarray",",","shape","(","n_users",",","k",")","The","user","latent","factors",".","V",":","ndarray",",","shape","(","n_items",",","k",")","The","item","latent","factors",".","References","--","--","--","--","--","*","Le",",","D.","D.",",","&","Lauw",",","H.","W.","(","2016",",","June",")",".","Euclidean","co-embedding","of","ordinal","data","for","multi-type","visualization",".","In","Proceedings","of","the","2016","SIAM","International","Conference","on","Data","Mining","(","pp",".","396-404",")",".","Society","for","Industrial","and","Applied","Mathematics","."]
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 np.sum(
              (self.V - self.U[user_idx, :]) ** 2, axis=-1
          ) ** (1.0 / 2)
  
      return np.sum(
          (self.V[item_idx, :] - self.U[user_idx, :]) ** 2, axis=-1
      ) ** (1.0 / 2)
  
file_path: cornac/cornac/models/coe/recom_coe.py
imports: import numpy
  from ..recommender import Recommender
  from ..recommender import ANNMixin, MEASURE_L2
  from ...exception import ScoreException
label_desc: Use image node_id 3 for calling the COE obj's underlying member method code with example usage: obj.score(user_idx, item_idx) and returns: unknown, unknown