Histogram

class mastml.plots.Histogram[source]

Bases: object

Class to generate histogram plots, such as histograms of residual values

Args:

None

Methods:
plot_histogram: method to plot a basic histogram of supplied data
Args:

df: (pd.DataFrame), dataframe or series of data to plot as a histogram

savepath: (str), string denoting the save path for the figure image

file_name: (str), string denoting the character of the file name, e.g. train vs. test

x_label: (str), string denoting the property name

show_figure: (bool), whether or not to show the figure output (e.g. when using Jupyter notebook)

Returns:

None

plot_residuals_histogram: method to plot a histogram of residual values
Args:

y_true: (pd.Series), series of true y data

y_pred: (pd.Series), series of predicted y data

savepath: (str), string denoting the save path for the figure image

file_name: (str), string denoting the character of the file name, e.g. train vs. test

show_figure: (bool), whether or not to show the figure output (e.g. when using Jupyter notebook)

Returns:

None

_get_histogram_bins: Method to obtain the number of bins to use when plotting a histogram
Args:

df: (pandas Series or numpy array), array of y data used to construct histogram

Returns:

num_bins: (int), the number of bins to use when plotting a histogram

Methods Summary

plot_histogram(df, savepath, file_name, x_label)

plot_residuals_histogram(y_true, y_pred, ...)

Methods Documentation

classmethod plot_histogram(df, savepath, file_name, x_label, show_figure=False, file_extension='.csv', image_dpi=250)[source]
classmethod plot_residuals_histogram(y_true, y_pred, savepath, show_figure=False, file_extension='.csv', image_dpi=250, file_name='residual_histogram')[source]