plot_confusion_matrix

mastml.plot_helper.plot_confusion_matrix(y_true, y_pred, savepath, stats, normalize=False, title='Confusion matrix', cmap=<matplotlib.colors.LinearSegmentedColormap object>)[source]

Method used to generate a confusion matrix for a classification run. Additional information can be found at: http://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html

Args:

y_true: (numpy array), array containing the true y data values

y_pred: (numpy array), array containing the predicted y data values

savepath: (str), path to save the plotted confusion matrix

stats: (dict), dict of training or testing statistics for a particular run

normalize: (bool), whether or not to normalize data output as truncated float vs. double

title: (str), title of the confusion matrix plot

cmap: (matplotlib colormap), the color map to use for confusion matrix plotting

Returns:

None