OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

sklearn ImportError: cannot import name plot_roc_curve

  • Thread starter Thread starter Achintha Ihalage
  • Start date Start date
A

Achintha Ihalage

Guest
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.

Code:
from sklearn.metrics import plot_roc_curve

Error:

Code:
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.

Code:
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?
<p>I am trying to plot a Receiver Operating Characteristics (ROC) curve with cross validation, following the <a href="https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc_crossval.html" rel="noreferrer">example</a> provided in sklearn's documentation. However, the following import gives an <code>ImportError</code>, in both <code>python2</code> and <code>python3</code>.</p>

<pre><code>from sklearn.metrics import plot_roc_curve
</code></pre>

<p><strong>Error:</strong></p>

<pre><code>Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name plot_roc_curve
</code></pre>

<p><code>python-2.7</code> sklearn version: <code>0.20.2.</code></p>

<p><code>python-3.6</code> sklearn version: <code>0.21.3.</code></p>

<p>I found that the following import works fine, but it's not quite the same as <code>plot_roc_curve</code>.</p>

<pre><code>from sklearn.metrics import roc_curve
</code></pre>

<p>Is <code>plot_roc_curve</code> deprecated? Could somebody try the code and let me know the sklearn version if it works?</p>
 

Latest posts

Top