class_docstr: Collaborative Topic Regression.
  
  Parameters
  ----------
  name: string, default: 'CTR'
      The name of the recommender model.
  
  k: int, optional, default: 200
      The dimension of the latent factors.
  
  max_iter: int, optional, default: 100
      Maximum number of iterations or the number of epochs for SGD.
  
  lambda_u: float, optional, default: 0.01
      The regularization parameter for users.
  
  lambda_v: float, optional, default: 0.01
      The regularization parameter for items.
  
  a: float, optional, default: 1
      The confidence of observed ratings.
  
  b: float, optional, default: 0.01
      The confidence of unseen ratings.
  
  eta: float, optional, default: 0.01
      Added value for smoothing phi.
  
  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).
  
  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, optional initialization via init_params.
      V: ndarray, shape (n_items,k)
          The item latent factors, optional initialization via init_params.
  
  seed: int, optional, default: None
      Random seed for weight initialization.
  
  References
  ----------
  Wang, Chong, and David M. Blei. "Collaborative topic modeling for recommending scientific articles."
  Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2011.
class_docstr_tok: ["Collaborative","Topic","Regression",".","Parameters","--","--","--","--","--","name",":","string",",","default",":","'CTR'","The","name","of","the","recommender","model",".","k",":","int",",","optional",",","default",":","200","The","dimension","of","the","latent","factors",".","max_iter",":","int",",","optional",",","default",":","100","Maximum","number","of","iterations","or","the","number","of","epochs","for","SGD",".","lambda_u",":","float",",","optional",",","default",":","0.01","The","regularization","parameter","for","users",".","lambda_v",":","float",",","optional",",","default",":","0.01","The","regularization","parameter","for","items",".","a",":","float",",","optional",",","default",":","1","The","confidence","of","observed","ratings",".","b",":","float",",","optional",",","default",":","0.01","The","confidence","of","unseen","ratings",".","eta",":","float",",","optional",",","default",":","0.01","Added","value","for","smoothing","phi",".","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",")",".","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",",","optional","initialization","via","init_params",".","V",":","ndarray",",","shape","(","n_items",",","k",")","The","item","latent","factors",",","optional","initialization","via","init_params",".","seed",":","int",",","optional",",","default",":","None","Random","seed","for","weight","initialization",".","References","--","--","--","--","--","Wang",",","Chong",",","and","David","M.","Blei",".","``","Collaborative","topic","modeling","for","recommending","scientific","articles",".","''","Proceedings","of","the","17th","ACM","SIGKDD","international","conference","on","Knowledge","discovery","and","data","mining",".","ACM",",","2011","."]
code: def __init__(
      self,
      name="CTR",
      k=200,
      lambda_u=0.01,
      lambda_v=0.01,
      eta=0.01,
      a=1,
      b=0.01,
      max_iter=100,
      trainable=True,
      verbose=True,
      init_params=None,
      seed=None,
  ):
      super().__init__(name=name, trainable=trainable, verbose=verbose)
      self.k = k
      self.lambda_u = lambda_u
      self.lambda_v = lambda_v
      self.a = a
      self.b = b
      self.eta = eta
      self.name = name
      self.max_iter = max_iter
      self.verbose = verbose
      self.seed = seed
  
      # Init params if provided
      self.init_params = {} if init_params is None else init_params
      self.U = self.init_params.get("U", None)
      self.V = self.init_params.get("V", None)
  
file_path: cornac/cornac/models/ctr/recom_ctr.py
imports: import numpy
  from tqdm.auto import trange
  from ..recommender import Recommender
  from ..recommender import ANNMixin, MEASURE_DOT
  from ...exception import ScoreException
  from ...utils import get_rng
  from ...utils.init_utils import xavier_uniform
label_desc: Use image node_id 1 to create a new CTR object from inherited base classes: Recommender with example: obj = CTR(name, k, lambda_u, lambda_v, eta, a, b, max_iter, trainable, verbose, init_params, seed)