I am trying to plot a Receiver Operating Characteristics (ROC) curve with cross validation, following the example provided in sklearn's documentation. However, the following import gives an ImportError
, in both python2
and python3
.
from sklearn.metrics import plot_roc_curve
Error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name plot_roc_curve
python-2.7
sklearn version: 0.20.2.
python-3.6
sklearn version: 0.21.3.
I found that the following import works fine, but it's not quite the same as plot_roc_curve
.
from sklearn.metrics import roc_curve
Is plot_roc_curve
deprecated? Could somebody try the code and let me know the sklearn version if it works?
Install scikit-plot and import the metric from there:
from scikitplot.metrics import plot_roc_curve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With