@@ -328,9 +328,10 @@ def plot_roc_curve(y_true, y_probas, title='ROC Curves',
328
328
329
329
330
330
def 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 ,):
334
335
"""Generates the ROC curves from labels and predicted scores/probabilities
335
336
336
337
Args:
@@ -372,6 +373,9 @@ def plot_roc(y_true, y_probas, title='ROC Curves',
372
373
text_fontsize (string or int, optional): Matplotlib-style fontsizes.
373
374
Use e.g. "small", "medium", "large" or integer-values. Defaults to
374
375
"medium".
376
+
377
+ show_labels (boolean, optional): Shows the labels in the plot.
378
+ Defaults to ``True``.
375
379
376
380
Returns:
377
381
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',
455
459
ax .set_xlabel ('False Positive Rate' , fontsize = text_fontsize )
456
460
ax .set_ylabel ('True Positive Rate' , fontsize = text_fontsize )
457
461
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 )
459
464
return ax
460
465
461
466
0 commit comments