Skip to content

plot_roc


method plot_roc(models=None, dataset="test", title=None, figsize=(10, 6), filename=None, display=True) [source]

Plot the Receiver Operating Characteristics Curve (ROC). The legend shows the Area Under the ROC Curve (AUC) score. Only for binary classification tasks. Read more about ROC in sklearn's documentation.

Parameters:

models: str, sequence or None, optional (default=None)
Name of the models to plot. If None, all models in the pipeline are selected.

dataset: str, optional (default="test")
Data set on which to calculate the metric. Options are "train", "test" or "both".

title: str or None, optional (default=None)
Plot's title. If None, the title is left empty.

figsize: tuple, optional (default=(10, 6))
Figure's size, format as (x, y).

filename: str or None, optional (default=None)
Name of the file. Use "auto" for automatic naming. If None, the figure is not saved.

display: bool or None, optional (default=True)
Whether to render the plot. If None, it returns the matplotlib figure.

Returns: fig: matplotlib.figure.Figure
Plot object. Only returned if display=None.


Example

from atom import ATOMClassifier
atom = ATOMClassifier(X, y)
atom.run(["LR", "RF", "LGB"], metric="roc_auc")
atom.plot_roc(filename="roc_curve")
plot_roc
Back to top