class_docstr: ```
  Abstract class used to tune and train Keras models. The fit method is
  an abstract method and must be implemented by subclasses.
  ```
class_docstr_tok: ["``","`","Abstract","class","used","to","tune","and","train","Keras","models",".","The","fit","method","is","an","abstract","method","and","must","be","implemented","by","subclasses",".","``","`"]
docstr: ```
  plots training history
  Args:
    plot_type (str):  A valid value in tf.keras History.  Either a built-in value  {'loss', 'lr', 'momentum'} or
                      other values previously specified by user.  For instance, if 'mae' and/or 'mse' is previously specified as metrics
                      when creating model, then these values can also be specified.
    return_fig(bool):  If True, return matplotlib.figure.Figure
  Return:
    matplotlib.figure.Figure if return_fig else None
  ```
docstr_tok: ["``","`","plots","training","history","Args",":","plot_type","(","str",")",":","A","valid","value","in","tf.keras","History",".","Either","a","built-in","value","{","'loss","'",",","'lr","'",",","'momentum","'","}","or","other","values","previously","specified","by","user",".","For","instance",",","if","'mae","'","and\/or","'mse","'","is","previously","specified","as","metrics","when","creating","model",",","then","these","values","can","also","be","specified",".","return_fig","(","bool",")",":","If","True",",","return","matplotlib.figure.Figure","Return",":","matplotlib.figure.Figure","if","return_fig","else","None","``","`"]
code: def plot(self, plot_type="loss", return_fig=False):
      """
      ```
      plots training history
      Args:
        plot_type (str):  A valid value in tf.keras History.  Either a built-in value  {'loss', 'lr', 'momentum'} or
                          other values previously specified by user.  For instance, if 'mae' and/or 'mse' is previously specified as metrics
                          when creating model, then these values can also be specified.
        return_fig(bool):  If True, return matplotlib.figure.Figure
      Return:
        matplotlib.figure.Figure if return_fig else None
      ```
      """
      if self.history is None:
          raise Exception(
              "No training history - did you train the model yet?"
          )
      if not isinstance(plot_type, str):
          raise ValueError("plot_type must be str/string")
  
      fig = None
      if plot_type == "loss":
          plt.plot(self.history.history["loss"])
          if "val_loss" in self.history.history:
              plt.plot(self.history.history["val_loss"])
              legend_items = ["train", "validation"]
          else:
              legend_items = ["train"]
          plt.title("Model Loss")
          plt.ylabel("loss")
          plt.xlabel("epoch")
          plt.legend(legend_items, loc="upper left")
      elif plot_type == "lr":
          if "lr" not in self.history.history:
              raise ValueError(
                  "no lr in history: are you sure you used autofit or fit_onecycle to train?"
              )
          plt.plot(self.history.history["lr"])
          plt.title("LR Schedule")
          plt.ylabel("lr")
          plt.xlabel("iterations")
      elif plot_type == "momentum":
          if "momentum" not in self.history.history:
              raise ValueError(
                  "no momentum history: are you sure you used autofit or fit_onecycle to train?"
              )
          plt.plot(self.history.history["momentum"])
          plt.title("Momentum Schedule")
          plt.ylabel("momentum")
          plt.xlabel("iterations")
      else:
          if plot_type not in self.history.history:
              raise ValueError(
                  f"no {plot_type} in history: are you sure {plot_type} exists in history?"
              )
          plt.plot(self.history.history[plot_type])
  
          val_key = f"val_{plot_type}"
          if val_key in self.history.history:
              plt.plot(self.history.history[val_key])
              legend_items = ["train", "validation"]
          else:
              warnings.warn(
                  f"Validation value for {plot_type} wasn't found in history"
              )
              legend_items = ["train"]
  
          plt.title(f"History of {plot_type}")
          plt.ylabel(plot_type)
          plt.xlabel("epoch")
          plt.legend(legend_items, loc="upper left")
      fig = plt.gcf()
      plt.show()
      if return_fig:
          return fig
      return
  
imports: from .None import utils
  from .graph.predictor import LinkPredictor, NodePredictor
  from .graph.preprocessor import LinkPreprocessor, NodePreprocessor
  from .imports import *
  from .lroptimize.lrfinder import *
  from .tabular.predictor import TabularPredictor
  from .tabular.preprocessor import TabularPreprocessor
  from .text.ner.predictor import NERPredictor
  from .text.ner.preprocessor import NERPreprocessor
  from .text.predictor import TextPredictor
  from .text.preprocessor import BERTPreprocessor, TextPreprocessor, TransformersPreprocessor
  from .vision.predictor import ImagePredictor
  from .vision.preprocessor import ImagePreprocessor
label_desc: Use image node_id 22 for calling the Learner obj's underlying member method code with example usage: obj.plot(plot_type, return_fig) and returns: fig