scikit-plot icon indicating copy to clipboard operation
scikit-plot copied to clipboard

Regarding the scikit-plot.metrics.plot_roc function

Open Akshay1-6180 opened this issue 4 years ago • 1 comments

In you code I noticed that if we pass classes in the form of their actual meaning instead of (0,1,2 .. ) and we pass it as (c,b,a) then np.unique(y_true) makes the classes in the form of its alphabetical format and this changes the position of the classes that the model was trained on classes = np.unique(y_true)

fpr_dict[i], tpr_dict[i], _ = roc_curve(y_true, probas[:, i], pos_label=classes[i])

Hence if you could add a parameter of class_labels in the function

def plot_roc_multi(y_true, y_probas,class_labels, title='ROC Curves', plot_micro=True, plot_macro=True, classes_to_plot=None, ax=None, figsize=None, cmap='nipy_spectral', title_fontsize="large", text_fontsize="medium"):

where class_labels is in the form of an array [a,b,c] it would be much easier I think

Akshay1-6180 avatar Jul 23 '21 13:07 Akshay1-6180

Yeah I also had a similar request that it would be good to allow us to specify the class label directly as a parameter where the class label is jut an array.

angerhang avatar Nov 04 '22 15:11 angerhang