reiinakano / scikit-plot

An intuitive library to add plotting functionality to scikit-learn objects.
MIT License
2.43k stars 284 forks source link

Regarding the scikit-plot.metrics.plot_roc function #115

Open Akshay1-6180 opened 3 years ago

Akshay1-6180 commented 3 years ago

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

angerhang commented 1 year ago

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.