docstr:  This class is base for all rating prediction algorithms. Inherits the class Recommender
   and implements / adds common methods and attributes for rating prediction approaches.
  
  :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 similarity_metric:
  :type similarity_metric: str, default cosine
  
  :param sep: Delimiter for input files
  :type sep: str, default '       '
  
  :param output_sep: Delimiter for output file
  :type output_sep: str, default '        '
docstr_tok: ["This","class","is","base","for","all","rating","prediction","algorithms",".","Inherits","the","class","Recommender","and","implements","\/","adds","common","methods","and","attributes","for","rating","prediction","approaches",".",":","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","similarity_metric",":",":","type","similarity_metric",":","str",",","default","cosine",":","param","sep",":","Delimiter","for","input","files",":","type","sep",":","str",",","default","'","'",":","param","output_sep",":","Delimiter","for","output","file",":","type","output_sep",":","str",",","default","'","'"]
code: def __init__(
      self,
      train_file,
      test_file,
      output_file=None,
      similarity_metric="cosine",
      sep="\t",
      output_sep="\t",
  ):
      """
       This class is base for all rating prediction algorithms. Inherits the class Recommender
       and implements / adds common methods and attributes for rating prediction approaches.
  
      :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 similarity_metric:
      :type similarity_metric: str, default cosine
  
      :param sep: Delimiter for input files
      :type sep: str, default '\t'
  
      :param output_sep: Delimiter for output file
      :type output_sep: str, default '\t'
  
      """
  
      self.train_file = train_file
      self.test_file = test_file
      self.similarity_metric = similarity_metric
      self.output_file = output_file
      self.sep = sep
      self.output_sep = output_sep
  
      # internal vars
      self.item_to_item_id = {}
      self.item_id_to_item = {}
      self.user_to_user_id = {}
      self.user_id_to_user = {}
      self.train_set = None
      self.test_set = None
      self.users = None
      self.items = None
      self.matrix = None
      self.evaluation_results = None
      self.recommender_name = None
      self.extra_info_header = None
      self.predictions = []
  
file_path: CaseRecommender/caserec/recommenders/rating_prediction/base_rating_prediction.py
imports: from scipy.spatial.distance import squareform, pdist
  import numpy
  from caserec.evaluation.rating_prediction import RatingPredictionEvaluation
  from caserec.utils.extra_functions import print_header
  from caserec.utils.process_data import ReadFile, WriteFile
label_desc: Use image node_id 1 to create a new BaseRatingPrediction object from inherited base classes: object with example: obj = BaseRatingPrediction(train_file, test_file, output_file, similarity_metric, sep, output_sep)