docstr: Content Based Recommender for Item Recommendation
  
  Usage::
  
      >> ContentBased(train, test, similarity_file=similarity_file).compute()
  
  :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_file: File which contains the similarity set. This file needs to have at least 3 columns
  (item item similarity).
  :type similarity_file: str, default None
  
  :param rank_length: Size of the rank that must be generated by the predictions of the recommender algorithm
  :type rank_length: int, default 10
  
  :param similarity_sep: Delimiter for similarity or metadata file
  :type similarity_sep: str, default '    '
  
  :param sep: Delimiter for input files file
  :type sep: str, default '       '
  
  :param output_sep: Delimiter for output file
  :type output_sep: str, default '        '
docstr_tok: ["Content","Based","Recommender","for","Item","Recommendation","Usage",":",":",">",">","ContentBased","(","train",",","test",",","similarity_file=similarity_file",")",".compute","(",")",":","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_file",":","File","which","contains","the","similarity","set",".","This","file","needs","to","have","at","least","3","columns","(","item","item","similarity",")",".",":","type","similarity_file",":","str",",","default","None",":","param","rank_length",":","Size","of","the","rank","that","must","be","generated","by","the","predictions","of","the","recommender","algorithm",":","type","rank_length",":","int",",","default","10",":","param","similarity_sep",":","Delimiter","for","similarity","or","metadata","file",":","type","similarity_sep",":","str",",","default","'","'",":","param","sep",":","Delimiter","for","input","files","file",":","type","sep",":","str",",","default","'","'",":","param","output_sep",":","Delimiter","for","output","file",":","type","output_sep",":","str",",","default","'","'"]
code: def __init__(
      self,
      train_file=None,
      test_file=None,
      output_file=None,
      similarity_file=None,
      similarity_sep="\t",
      rank_length=10,
      as_binary=True,
      sep="\t",
      output_sep="\t",
  ):
      """
      Content Based Recommender for Item Recommendation
  
      Usage::
  
          >> ContentBased(train, test, similarity_file=similarity_file).compute()
  
      :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_file: File which contains the similarity set. This file needs to have at least 3 columns
      (item item similarity).
      :type similarity_file: str, default None
  
      :param rank_length: Size of the rank that must be generated by the predictions of the recommender algorithm
      :type rank_length: int, default 10
  
      :param similarity_sep: Delimiter for similarity or metadata file
      :type similarity_sep: str, default '\t'
  
      :param sep: Delimiter for input files file
      :type sep: str, default '\t'
  
      :param output_sep: Delimiter for output file
      :type output_sep: str, default '\t'
  
      """
  
      super(ContentBased, self).__init__(
          train_file=train_file,
          test_file=test_file,
          output_file=output_file,
          as_binary=as_binary,
          rank_length=rank_length,
          sep=sep,
          output_sep=output_sep,
      )
  
      self.recommender_name = "Content Based Algorithm"
  
      self.similarity_file = similarity_file
      self.similarity_sep = similarity_sep
      self.si_matrix = None
      self.similar_items = None
  
      self.users_profile = None
  
file_path: CaseRecommender/caserec/recommenders/item_recommendation/content_based.py
imports: import numpy
  from caserec.recommenders.item_recommendation.base_item_recommendation import BaseItemRecommendation
  from caserec.utils.process_data import ReadFile
  from caserec.utils.extra_functions import timed
label_desc: Use image node_id 1 to create a new ContentBased object from inherited base classes: BaseItemRecommendation with example: obj = ContentBased(train_file, test_file, output_file, similarity_file, similarity_sep, rank_length, as_binary, sep, output_sep)