code: def fit(self, trainset):
      # Here again: call base method before doing anything.
      AlgoBase.fit(self, trainset)
  
      # Compute the average rating. We might as well use the
      # trainset.global_mean attribute ;)
      self.the_mean = np.mean(
          [r for (_, _, r) in self.trainset.all_ratings()]
      )
  
      return self
  
file_path: Surprise/examples/building_custom_algorithms/most_basic_algorithm2.py
imports: import numpy
  from surprise import AlgoBase, Dataset
  from surprise.model_selection import cross_validate
label_desc: Use image node_id 2 for calling the MyOwnAlgorithm obj's underlying member method code with example usage: obj.fit(trainset) and returns: self