class_docstr: Collaborative Context Poisson Factorization.
  
  Parameters
  ----------
  k: int, optional, default: 100
      The dimension of the latent factors.
  
  max_iter: int, optional, default: 100
      Maximum number of iterations for variational C2PF.
  
  variant: string, optional, default: 'c2pf'
      C2pf's variant: c2pf: 'c2pf', 'tc2pf' (tied-c2pf) or 'rc2pf' (reduced-c2pf).         Please refer to the original paper for details.
  
  name: string, optional, default: None
      The name of the recommender model. If None,         then "variant" is used as the default name of the model.
  
  trainable: boolean, optional, default: True
      When False, the model is not trained and Cornac assumes that the model already         pre-trained (Theta, Beta and Xi are not None).
  
  Item_context: See "cornac/examples/c2pf_example.py" in the GitHub repo for an example of how to use         cornac's graph modality to load and provide "item context" for C2PF.
  
  init_params: dict, optional, default: None
      List of initial parameters, e.g., init_params = {'G_s':G_s, 'G_r':G_r, 'L_s':L_s, 'L_r':L_r, 'L2_s':L2_s, 'L2_r':L2_r, 'L3_s':L3_s, 'L3_r': L3_r}
  
      Theta: ndarray, shape (n_users, k)
          The expected user latent factors.
  
      Beta: ndarray, shape (n_items, k)
          The expected item latent factors.
  
      Xi: ndarray, shape (n_items, k)
          The expected context item latent factors multiplied by context effects Kappa.
          
      G_s: ndarray, shape (n_users, k)
          Represent the "shape" parameters of Gamma distribution over Theta.
          
      G_r: ndarray, shape (n_users, k)
          Represent the "rate" parameters of Gamma distribution over Theta. 
      
      L_s: ndarray, shape (n_items, k)
          Represent the "shape" parameters of Gamma distribution over Beta.
          
      L_r: ndarray, shape (n_items, k)
          Represent the "rate" parameters of Gamma distribution over Beta. 
      
      L2_s: ndarray, shape (n_items, k)
          Represent the "shape" parameters of Gamma distribution over Xi.
          
      L2_r: ndarray, shape (n_items, k)
          Represent the "rate" parameters of Gamma distribution over Xi.
           
      L3_s: ndarray
          Represent the "shape" parameters of Gamma distribution over Kappa.
          
      L3_r: ndarray 
          Represent the "rate" parameters of Gamma distribution over Kappa.
  
  References
  ----------
  * Salah, Aghiles, and Hady W. Lauw. A Bayesian Latent Variable Model of User Preferences with Item Context.     In IJCAI, pp. 2667-2674. 2018.
code: def __init__(
      self,
      k=100,
      max_iter=100,
      variant="c2pf",
      name=None,
      trainable=True,
      verbose=False,
      init_params=None,
  ):
      if name is None:
          Recommender.__init__(
              self,
              name=variant.upper(),
              trainable=trainable,
              verbose=verbose,
          )
      else:
          Recommender.__init__(
              self, name=name, trainable=trainable, verbose=verbose
          )
  
      self.k = k
      self.max_iter = max_iter
  
      self.ll = np.full(max_iter, 0)
      self.eps = 0.000000001
      # self.aux_info = aux_info  # item-context matrix in the triplet sparse format: (row_id, col_id, value)
      self.variant = variant
  
      # Init params if provided
      self.init_params = {} if init_params is None else init_params
      self.Theta = self.init_params.get("Theta", None)
      self.Beta = self.init_params.get("Beta", None)
      self.Xi = self.init_params.get("Xi", None)
      self.Gs = self.init_params.get("G_s", None)
      self.Gr = self.init_params.get("G_r", None)
      self.Ls = self.init_params.get("L_s", None)
      self.Lr = self.init_params.get("L_r", None)
      self.L2s = self.init_params.get("L2_s", None)
      self.L2r = self.init_params.get("L2_r", None)
      self.L3s = self.init_params.get("L3_s", None)
      self.L3r = self.init_params.get("L3_r", None)
  
file_path: cornac/cornac/models/c2pf/recom_c2pf.py
imports: import numpy
  import scipy.sparse
  from cornac.models.c2pf import c2pf
  from ..recommender import Recommender
  from ..recommender import ANNMixin, MEASURE_DOT
label_desc: Use image node_id 1 to create a new C2PF object from inherited base classes: Recommender, ANNMixin with example: obj = C2PF(k, max_iter, variant, name, trainable, verbose, init_params)