src.plot.training_history_plot

Classes

TrainingHistoryPlot(history, **kwargs)

class src.plot.training_history_plot.TrainingHistoryPlot(history, **kwargs)
Author:

Alberto M. Esmoris Pena

Class to plot (potentially many plots) the training history of a deep learning model, i.e., neural networks.

Variables:
  • history (keras.callbacks.History) – The history.

  • filter (str or None) – The name of the filter to be applied (None means no filtering ).

__init__(history, **kwargs)

Initialize a MplPlot.

Parameters:

kwargs – The attributes for the MplPlot.

plot(**kwargs)

Do the plots related to the training history.

See plot.Plot.plot()

do_isolated_plot(epochs, name, values, **kwargs)

Method to do handle the plot for each metric in the history.

Parameters:
  • epochs (list) – The sequence of numbers representing the involved epochs, e.g., [0, 1, 2, 3, 4].

  • name (str) – The name of the metric.

  • values (list or tuple or np.ndarray) – The values of the metric.

  • kwargs – The key-word arguments. See plot.Plot.plot().

Returns:

Nothing at all, but the plot plot is exported.

do_summary_plot(epochs, **kwargs)

Method to do handle the summary plot representing all metrics in the history.

Parameters:
  • epochs (list) – The sequence of numbers representing the involved epochs, e.g., [0, 1, 2, 3, 4].

  • kwargs – The key-word arguments. See plot.Plot.plot().

Returns:

Nothing at all, but the plot subplot is exported.

format_plot(fig, ax, name, values)

Apply format to given plot.

Parameters:
  • fig – The plot’s figure.

  • ax – The plot’s axes.

  • name – The y label for the plot.

  • values – The plotted values.

Returns:

Nothing at all, but the format of the input plot is updated.

filter_values(values)

Filter given values. There are three possible filter modes.

Filter: None

No filter is returned.

Filter: “quartile”

The \([Q_1-\frac{3}{2}\mathrm{IQR}, Q_3+\frac{3}{2}\mathrm{IQR}]\) filter is returned.

Filter: “stdev”

The \([\mu-3\sigma, mu+3\sigma]\) filter is returned. Where \(\mu\) is the mean and \(\sigma\) is the standard deviation.

Parameters:

values (tuple or list or np.ndarray) – The values to be filtered.

Returns:

The min and max values defining the filtering interval.

Return type:

tuple