def METHOD_NAME(self):
    """
    Generate the user/item index:
    map_users, map_items: dictionaries mapping the original user/item index to matrix indices
    map_back_users, map_back_items: dictionaries to map back the matrix elements to the original
    dataframe indices
    Basic mechanics:
    As a first step we retieve the unique elements in the dataset. In this way we can take care
    of either completely missing rows (a user with no ratings) or completely missing columns
    (an item that has not being reviewed by anyone). The original indices in the dataframe are
    then mapped to an ordered, contiguous integer series to generate a compact matrix representation.
    Functions to map back to the original indices are also provided and can be saved in order to use
    a pretrained model.
    """
    # sort entries by user index
    self.df_ = self.df.sort_values(by=[self.col_user])
    # find unique user and item index
    unique_users = self.df_[self.col_user].unique()
    if self.items_list is not None:
        unique_items = self.items_list  # use this list if provided
    else:
        unique_items = self.df_[
            self.col_item
        ].unique()  # otherwise use unique items from DF
    self.Nusers = len(unique_users)
    self.Nitems = len(unique_items)
    # create a dictionary to map unique users/items to hashed values to generate the matrix
    self.map_users = {x: i for i, x in enumerate(unique_users)}
    self.map_items = {x: i for i, x in enumerate(unique_items)}
    # map back functions used to get back the original dataframe
    self.map_back_users = {i: x for i, x in enumerate(unique_users)}
    self.map_back_items = {i: x for i, x in enumerate(unique_items)}
    self.df_.loc[:, "hashedItems"] = self.df_[self.col_item].map(self.map_items)
    self.df_.loc[:, "hashedUsers"] = self.df_[self.col_user].map(self.map_users)
    # optionally save the inverse dictionary to work with trained models
    if self.save_path is not None:
        np.save(self.save_path + "/user_dict", self.map_users)
        np.save(self.save_path + "/item_dict", self.map_items)
        np.save(self.save_path + "/user_back_dict", self.map_back_users)
        np.save(self.save_path + "/item_back_dict", self.map_back_items)