docstr: Method to read files and collect important information.
  
  :return: Dictionary with file information
  :rtype: dict
docstr_tok: ["Method","to","read","files","and","collect","important","information",".",":","return",":","Dictionary","with","file","information",":","rtype",":","dict"]
code: def read(self):
      """
      Method to read files and collect important information.
  
      :return: Dictionary with file information
      :rtype: dict
  
      """
  
      list_users = set()
      list_items = set()
  
      list_feedback = []
  
      dict_feedback = (
          {}
      )  # To be filled as: {user_id: [item_id_1, item_id_2, ..., item_id_N]}
      items_unobserved = {}
      items_seen_by_user = {}
      users_viewed_item = {}
  
      mean_value = 0
      number_interactions = 0
  
      with open(self.input_file) as infile:
          for line in infile:
              if line.strip():
                  inline = line.split(self.sep)
                  if len(inline) == 1:
                      raise TypeError(
                          "Error: Space type (sep) is invalid!"
                      )
  
                  user, item, value = (
                      int(inline[0]),
                      int(inline[1]),
                      float(inline[2]),
                  )
  
                  dict_feedback.setdefault(user, {}).update(
                      {item: 1.0 if self.as_binary else value}
                  )
                  items_seen_by_user.setdefault(user, set()).add(item)
                  users_viewed_item.setdefault(item, set()).add(user)
  
                  list_users.add(user)
                  list_items.add(item)
  
                  mean_value += 1.0 if self.as_binary else value
                  list_feedback.append(1.0 if self.as_binary else value)
                  number_interactions += 1
  
      mean_value /= float(number_interactions)
  
      list_users = sorted(list(list_users))
      list_items = sorted(list(list_items))
  
      # Create a dictionary with unobserved items for each user / Map user with its respective id
      for user in list_users:
          items_unobserved[user] = list(
              set(list_items) - set(items_seen_by_user[user])
          )
  
      # Calculate the sparsity of the set: N / (nu * ni)
      sparsity = (
          1
          - (
              number_interactions
              / float(len(list_users) * len(list_items))
          )
      ) * 100
  
      dict_file = {
          "feedback": dict_feedback,
          "users": list_users,
          "items": list_items,
          "sparsity": sparsity,
          "number_interactions": number_interactions,
          "users_viewed_item": users_viewed_item,
          "items_unobserved": items_unobserved,
          "items_seen_by_user": items_seen_by_user,
          "mean_value": mean_value,
          "max_value": max(list_feedback),
          "min_value": min(list_feedback),
      }
  
      return dict_file
  
file_path: CaseRecommender/caserec/utils/process_data.py
imports: import pandas
  from caserec.utils.extra_functions import check_error_file
label_desc: Use image node_id 2 for calling the ReadFile obj's underlying member method code with example usage: obj.read() and returns: dict_file