Closed TarunTater closed 6 years ago
In the scikit-plot, if you want to plot the ROC curve for a binary classification problem, the needed prob is a 2-dimentional array, maybe you just past a 1-D prob to the plot_roc_curve(). So you need to make the 1-D to 2-D just like this : np.concatenate((1-y_probas,y_probas),axis=1). Try this .
@lugq1990 is correct. I never liked scikit-learn's roc_curve
because I had to pick a positive class. I designed plot_roc_curve
to work directly with the output of predict_proba
.
Although I do realize now it could be useful for binary classifiers with decision_function
, whose output is a 1D array. Perhaps somebody could extend the code of plot_roc_curve
to work with a 1D array.
@lugq1990 - ya, changing the numpy array to 2D worked. Thanks for your suggestion!
This exact problem is occurring for me. I'll try @lugq1990 's solution. Thank you!
For binary classification, when I input numpy arrays having test label and test probabilities, it throws the following error :