@@ -328,9 +328,10 @@ def plot_roc_curve(y_true, y_probas, title='ROC Curves',
328328
329329
330330def plot_roc (y_true , y_probas , title = 'ROC Curves' ,
331- plot_micro = True , plot_macro = True , classes_to_plot = None ,
332- ax = None , figsize = None , cmap = 'nipy_spectral' ,
333- title_fontsize = "large" , text_fontsize = "medium" ):
331+ plot_micro = True , plot_macro = True , classes_to_plot = None ,
332+ ax = None , figsize = None , cmap = 'nipy_spectral' ,
333+ title_fontsize = "large" , text_fontsize = "medium" ,
334+ show_labels = True ,):
334335 """Generates the ROC curves from labels and predicted scores/probabilities
335336
336337 Args:
@@ -372,6 +373,9 @@ def plot_roc(y_true, y_probas, title='ROC Curves',
372373 text_fontsize (string or int, optional): Matplotlib-style fontsizes.
373374 Use e.g. "small", "medium", "large" or integer-values. Defaults to
374375 "medium".
376+
377+ show_labels (boolean, optional): Shows the labels in the plot.
378+ Defaults to ``True``.
375379
376380 Returns:
377381 ax (:class:`matplotlib.axes.Axes`): The axes on which the plot was
@@ -455,7 +459,8 @@ def plot_roc(y_true, y_probas, title='ROC Curves',
455459 ax .set_xlabel ('False Positive Rate' , fontsize = text_fontsize )
456460 ax .set_ylabel ('True Positive Rate' , fontsize = text_fontsize )
457461 ax .tick_params (labelsize = text_fontsize )
458- ax .legend (loc = 'lower right' , fontsize = text_fontsize )
462+ if show_labels is True :
463+ ax .legend (loc = 'lower right' , fontsize = text_fontsize )
459464 return ax
460465
461466
0 commit comments