docstr: This class is base for all NSVD1 algorithms.
  
  :param train_file: File which contains the train set. This file needs to have at least 3 columns
  (user item feedback_value).
  :type train_file: str
  
  :param test_file: File which contains the test set. This file needs to have at least 3 columns
  (user item feedback_value).
  :type test_file: str, default None
  
  :param output_file: File with dir to write the final predictions
  :type output_file: str, default None
  
  :param factors: Number of latent factors per user/item
  :type factors: int, default 10
  
  :param init_mean: Mean of the normal distribution used to initialize the latent factors
  :type init_mean: float, default 0
  
  :param init_stdev: Standard deviation of the normal distribution used to initialize the latent factors
  :type init_stdev: float, default 0.1
  
  :param sep: Delimiter for input files
  :type sep: str, default'        '
  
  :param output_sep: Delimiter for output file
  :type output_sep: str, default '        '
  
  :param random_seed: Number of seed. Lock random numbers for reproducibility of experiments.
  :type random_seed: int, default None
docstr_tok: ["This","class","is","base","for","all","NSVD1","algorithms",".",":","param","train_file",":","File","which","contains","the","train","set",".","This","file","needs","to","have","at","least","3","columns","(","user","item","feedback_value",")",".",":","type","train_file",":","str",":","param","test_file",":","File","which","contains","the","test","set",".","This","file","needs","to","have","at","least","3","columns","(","user","item","feedback_value",")",".",":","type","test_file",":","str",",","default","None",":","param","output_file",":","File","with","dir","to","write","the","final","predictions",":","type","output_file",":","str",",","default","None",":","param","factors",":","Number","of","latent","factors","per","user\/item",":","type","factors",":","int",",","default","10",":","param","init_mean",":","Mean","of","the","normal","distribution","used","to","initialize","the","latent","factors",":","type","init_mean",":","float",",","default","0",":","param","init_stdev",":","Standard","deviation","of","the","normal","distribution","used","to","initialize","the","latent","factors",":","type","init_stdev",":","float",",","default","0.1",":","param","sep",":","Delimiter","for","input","files",":","type","sep",":","str",",","default","'","'",":","param","output_sep",":","Delimiter","for","output","file",":","type","output_sep",":","str",",","default","'","'",":","param","random_seed",":","Number","of","seed",".","Lock","random","numbers","for","reproducibility","of","experiments",".",":","type","random_seed",":","int",",","default","None"]
code: def __init__(
      self,
      train_file,
      test_file,
      output_file=None,
      factors=10,
      init_mean=0,
      init_stdev=0.1,
      sep="\t",
      output_sep="\t",
      random_seed=None,
  ):
      """
      This class is base for all NSVD1 algorithms.
  
      :param train_file: File which contains the train set. This file needs to have at least 3 columns
      (user item feedback_value).
      :type train_file: str
  
      :param test_file: File which contains the test set. This file needs to have at least 3 columns
      (user item feedback_value).
      :type test_file: str, default None
  
      :param output_file: File with dir to write the final predictions
      :type output_file: str, default None
  
      :param factors: Number of latent factors per user/item
      :type factors: int, default 10
  
      :param init_mean: Mean of the normal distribution used to initialize the latent factors
      :type init_mean: float, default 0
  
      :param init_stdev: Standard deviation of the normal distribution used to initialize the latent factors
      :type init_stdev: float, default 0.1
  
      :param sep: Delimiter for input files
      :type sep: str, default'\t'
  
      :param output_sep: Delimiter for output file
      :type output_sep: str, default '\t'
  
      :param random_seed: Number of seed. Lock random numbers for reproducibility of experiments.
      :type random_seed: int, default None
  
      """
      super(BaseNSVD1, self).__init__(
          train_file=train_file,
          test_file=test_file,
          output_file=output_file,
          sep=sep,
          output_sep=output_sep,
      )
  
      self.factors = factors
      self.init_mean = init_mean
      self.init_stdev = init_stdev
  
      if random_seed is not None:
          np.random.seed(random_seed)
  
      # internal vars
      self.number_users = len(self.users)
      self.number_items = len(self.items)
      self.item_to_item_id = {}
      self.item_id_to_item = {}
      self.user_to_user_id = {}
      self.user_id_to_user = {}
      self.x = None
      self.p = None
      self.q = None
      self.w = None
      self.b = None
      self.c = None
      self.metadata = None
      self.number_metadata = None
  
      self.last_rmse = 0
      self.predictions = []
  
file_path: CaseRecommender/caserec/recommenders/rating_prediction/base_nsvd1.py
imports: import numpy
  from caserec.recommenders.rating_prediction.base_rating_prediction import BaseRatingPrediction
label_desc: Use image node_id 1 to create a new BaseNSVD1 object from inherited base classes: BaseRatingPrediction with example: obj = BaseNSVD1(train_file, test_file, output_file, factors, init_mean, init_stdev, sep, output_sep, random_seed)