class_docstr: Tool for building interaction and feature matrices, taking care of the
  mapping between user/item ids and feature names and internal feature indices.
  
  To create a dataset:
  - Create an instance of the `Dataset` class.
  - Call `fit` (or `fit_partial`), supplying user/item ids and feature names
    that you want to use in your model. This will create internal mappings that
    translate the ids and feature names to internal indices used by the LightFM
    model.
  - Call `build_interactions` with an iterable of (user id, item id) or (user id,
    item id, weight) to build an interactions and weights matrix.
  - Call `build_user/item_features` with iterables of (user/item id, [features])
    or (user/item id, {feature: feature weight}) to build feature matrices.
  - To add new user/item ids or features, call `fit_partial` again. You will need
    to resize your LightFM model to be able to use the new features.
  
  Parameters
  ----------
  
  user_identity_features: bool, optional
      Create a unique feature for every user in addition to other features.
      If true (default), a latent vector will be allocated for every user. This
      is a reasonable default for most applications, but should be set to false
      if there is very little data for every user. For more details see the Notes
      in :doc:`LightFM<lightfm>`.
  
  item_identity_features: bool, optional
      Create a unique feature for every item in addition to other features.
      If true (default), a latent vector will be allocated for every item. This
      is a reasonable default for most applications, but should be set to false
      if there is very little data for every item. For more details see the Notes
      in :doc:`LightFM<lightfm>`.
docstr: Fit the user/item id and feature name mappings.
  
  Calling fit the second time will reset existing mappings.
  
  Parameters
  ----------
  
  users: iterable of user ids
  items: iterable of item ids
  user_features: iterable of user features, optional
  item_features: iterable of item features, optional
docstr_tok: ["Fit","the","user\/item","id","and","feature","name","mappings",".","Calling","fit","the","second","time","will","reset","existing","mappings",".","Parameters","--","--","--","--","--","users",":","iterable","of","user","ids","items",":","iterable","of","item","ids","user_features",":","iterable","of","user","features",",","optional","item_features",":","iterable","of","item","features",",","optional"]
code: def fit(self, users, items, user_features=None, item_features=None):
      """
      Fit the user/item id and feature name mappings.
  
      Calling fit the second time will reset existing mappings.
  
      Parameters
      ----------
  
      users: iterable of user ids
      items: iterable of item ids
      user_features: iterable of user features, optional
      item_features: iterable of item features, optional
      """
  
      self._user_id_mapping = {}
      self._item_id_mapping = {}
      self._user_feature_mapping = {}
      self._item_feature_mapping = {}
  
      return self.fit_partial(
          users, items, user_features, item_features
      )
  
imports: import array
  import numpy
  import scipy.sparse
  import sklearn.preprocessing
label_desc: Use image node_id 3 for calling the Dataset obj's underlying member method code with example usage: obj.fit(users, items, user_features, item_features) and returns: self