class_docstr: Generic class for a recommender model. All recommendation models should inherit from this class.
  
  Parameters
  ----------------
  name: str, required
      Name of the recommender model.
  
  trainable: boolean, optional, default: True
      When False, the model is not trainable.
  
  verbose: boolean, optional, default: False
      When True, running logs are displayed.
  
  Attributes
  ----------
  num_users: int
      Number of users in training data.
  
  num_items: int
      Number of items in training data.
  
  total_users: int
      Number of users in training, validation, and test data.
      In other words, this includes unknown/unseen users.
  
  total_items: int
      Number of items in training, validation, and test data.
      In other words, this includes unknown/unseen items.
  
  uid_map: int
      Global mapping of user ID-index.
  
  iid_map: int
      Global mapping of item ID-index.
  
  max_rating: float
      Maximum value among the rating observations.
  
  min_rating: float
      Minimum value among the rating observations.
  
  global_mean: float
      Average value over the rating observations.
class_docstr_tok: ["Generic","class","for","a","recommender","model",".","All","recommendation","models","should","inherit","from","this","class",".","Parameters","--","--","--","--","--","--","--","--","name",":","str",",","required","Name","of","the","recommender","model",".","trainable",":","boolean",",","optional",",","default",":","True","When","False",",","the","model","is","not","trainable",".","verbose",":","boolean",",","optional",",","default",":","False","When","True",",","running","logs","are","displayed",".","Attributes","--","--","--","--","--","num_users",":","int","Number","of","users","in","training","data",".","num_items",":","int","Number","of","items","in","training","data",".","total_users",":","int","Number","of","users","in","training",",","validation",",","and","test","data",".","In","other","words",",","this","includes","unknown\/unseen","users",".","total_items",":","int","Number","of","items","in","training",",","validation",",","and","test","data",".","In","other","words",",","this","includes","unknown\/unseen","items",".","uid_map",":","int","Global","mapping","of","user","ID-index",".","iid_map",":","int","Global","mapping","of","item","ID-index",".","max_rating",":","float","Maximum","value","among","the","rating","observations",".","min_rating",":","float","Minimum","value","among","the","rating","observations",".","global_mean",":","float","Average","value","over","the","rating","observations","."]
docstr: Save a recommender model to the filesystem.
  
  Parameters
  ----------
  save_dir: str, default: None
      Path to a directory for the model to be stored.
  
  save_trainset: bool, default: False
      Save train_set together with the model. This is useful
      if we want to deploy model later because train_set is
      required for certain evaluation steps.
  
  Returns
  -------
  model_file : str
      Path to the model file stored on the filesystem.
docstr_tok: ["Save","a","recommender","model","to","the","filesystem",".","Parameters","--","--","--","--","--","save_dir",":","str",",","default",":","None","Path","to","a","directory","for","the","model","to","be","stored",".","save_trainset",":","bool",",","default",":","False","Save","train_set","together","with","the","model",".","This","is","useful","if","we","want","to","deploy","model","later","because","train_set","is","required","for","certain","evaluation","steps",".","Returns","--","--","--","-","model_file",":","str","Path","to","the","model","file","stored","on","the","filesystem","."]
code: def save(self, save_dir=None, save_trainset=False):
      """Save a recommender model to the filesystem.
  
      Parameters
      ----------
      save_dir: str, default: None
          Path to a directory for the model to be stored.
  
      save_trainset: bool, default: False
          Save train_set together with the model. This is useful
          if we want to deploy model later because train_set is
          required for certain evaluation steps.
  
      Returns
      -------
      model_file : str
          Path to the model file stored on the filesystem.
      """
      if save_dir is None:
          return
  
      model_dir = os.path.join(save_dir, self.name)
      os.makedirs(model_dir, exist_ok=True)
      timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S-%f")
      model_file = os.path.join(model_dir, "{}.pkl".format(timestamp))
  
      saved_model = copy.deepcopy(self)
      pickle.dump(
          saved_model,
          open(model_file, "wb"),
          protocol=pickle.HIGHEST_PROTOCOL,
      )
      if self.verbose:
          print("{} model is saved to {}".format(self.name, model_file))
  
      if save_trainset:
          pickle.dump(
              self.train_set,
              open(model_file + ".trainset", "wb"),
              protocol=pickle.HIGHEST_PROTOCOL,
          )
  
      return model_file
  
imports: import copy
  import inspect
  import os
  import pickle
  import warnings
  from datetime import datetime
  from glob import glob
  import numpy
  from ..exception import ScoreException
  from ..utils.common import clip
label_desc: Use image node_id 10 for calling the Recommender obj's underlying member method code with example usage: obj.save(save_dir, save_trainset) and returns: model_file