[scikit-learn] Roc curve from multilabel classification has slope

José Ismael Fernández Martínez ismaelfm_ at ciencias.unam.mx
Sat Jan 7 19:32:49 EST 2017


But is not a scikit-learn classifier, is a keras classifier which, in the functional API, predict returns probabilities.
What I don't understand is why my plot of the roc curve has a slope, since I call roc_curve passing the actual label as y_true and the output of the classifier (score probabilities) as y_score for every element tested.



Sent from my iPhone
> On Jan 7, 2017, at 4:04 PM, Joel Nothman <joel.nothman at gmail.com> wrote:
> 
> predict method should not return probabilities in scikit-learn classifiers. predict_proba should.
> 
>> On 8 January 2017 at 07:52, José Ismael Fernández Martínez <ismaelfm_ at ciencias.unam.mx> wrote:
>> Hi, I have a multilabel classifier written in Keras from which I want to compute AUC and plot a ROC curve for every element classified from my test set.
>> 
>> <image1.PNG>
>> 
>> Everything seems fine, except that some elements have a roc curve that have a slope as follows:
>> I don't know how to interpret the slope in such cases.
>> 
>> Basically my workflow goes as follows, I have a pre-trained model, instance of Keras, and I have the features X and the binarized labels y, every element in y is an array of length 1000, as it is a multilabel classification problem each element in y might contain many 1s, indicating that the element belongs to multiples classes, so I used the built-in loss of binary_crossentropy and my outputs of the model prediction are score probailities. Then I plot the roc curve as follows.
>> 
>> 
>> 
>> The predict method returns probabilities, as I'm using the functional api of keras.
>> 
>> Does anyone knows why my roc curves looks like this?
>> 
>> Ismael
>> 
>> 
>> Sent from my iPhone
>> 
>> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
>> 
> 
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170107/6f759a24/attachment-0001.html>


More information about the scikit-learn mailing list