reiinakano / scikit-plot

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

Plot ONLY one class #83

Closed foo123 closed 6 years ago

foo123 commented 6 years ago

Hello i have a precision-recall curve where i plot as the following:

skplt.metrics.plot_precision_recall_curve(y_test, y_probas, curves=['each_class'])

I have two classes in the data (one positive and one negative class with labels 1 and -1 respectively). Questions: How can I plot ONLY the positive class?

Thank you

reiinakano commented 6 years ago

No way to do this currently. This could be a PR though.

foo123 commented 6 years ago

Maybe if the curves parameter is a number (or a string different than each_class and micro), plot only this class from the data. This is what i can think right now

lugq1990 commented 6 years ago

@foo123 I have added a new key word as "positive" for the case when just want to plot the positive class. Default is the first class represented as the "positive". I will submit to it. @reiinakano please check it whether it is OK.

foo123 commented 6 years ago

@lugq1990 Please make sure the positive class is indeed the positive class. For example check the label is a positive number (this is how i make positive classes). Thank you

lugq1990 commented 6 years ago

@foo123 OK,because the owner want to rebuild the project, maybe I will need a little time to make the need of you satisfied. If I have finished it, I will tell you right now.

reiinakano commented 6 years ago

@foo123, sorry for the late progress, but in case you still needed this, it's available in 0.3.5

foo123 commented 6 years ago

@reiinakano thanks i take note.

siddagra commented 1 year ago

This is absolutely stupid. I spent HOURS trying to get this to work only to realise this library does not even support the most basic machine learning functionality: binary classification. U guys should seriously fix this, no wonder no one uses this library. Will move to sklearn and likely never use this again.