docstr: Train the model on train dataset.
  
  The fit method will train the model for a fixed
  number of epochs (iterations) on a dataset.
  
  Parameters
  ----------
  x_train : ndarray
      the x_train is the train dataset
  y_train : ndarray shape=(BatchSize,)
      the y_train is the labels of the train dataset
  epochs : int (Default = 5)
      the number of epochs
  
  Returns
  -------
  hist : object
      A History object. Its History.history attribute is a record of
      training loss values and metrics values at successive epochs
docstr_tok: ["Train","the","model","on","train","dataset",".","The","fit","method","will","train","the","model","for","a","fixed","number","of","epochs","(","iterations",")","on","a","dataset",".","Parameters","--","--","--","--","--","x_train",":","ndarray","the","x_train","is","the","train","dataset","y_train",":","ndarray","shape=","(","BatchSize",",",")","the","y_train","is","the","labels","of","the","train","dataset","epochs",":","int","(","Default","=","5",")","the","number","of","epochs","Returns","--","--","--","-","hist",":","object","A","History","object",".","Its","History.history","attribute","is","a","record","of","training","loss","values","and","metrics","values","at","successive","epochs"]
code: def fit(self, x_train, y_train, epochs=5):
      """Train the model on train dataset.
  
      The fit method will train the model for a fixed
      number of epochs (iterations) on a dataset.
  
      Parameters
      ----------
      x_train : ndarray
          the x_train is the train dataset
      y_train : ndarray shape=(BatchSize,)
          the y_train is the labels of the train dataset
      epochs : int (Default = 5)
          the number of epochs
  
      Returns
      -------
      hist : object
          A History object. Its History.history attribute is a record of
          training loss values and metrics values at successive epochs
  
      """
      hist = self.model.fit(x_train, y_train, epochs=epochs)
      self.accuracy = hist.history["accuracy"][0]
      self.loss = hist.history["loss"][0]
      return hist
  
file_path: dipy/dipy/nn/model.py
imports: from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 3 for calling the MultipleLayerPercepton obj's underlying member method code with example usage: obj.fit(x_train, y_train, epochs) and returns: hist