Issue
I don't know why I am getting this error, the official document reference
https://scikit-learn.org/stable/modules/generated/sklearn.metrics.det_curve.html#sklearn.metrics.det_curve
Code:
import numpy as np
from sklearn.metrics import det_curve
fpr, fnr, thresholds = det_curve(y_test, y_pred)
print(fpr, fnr, thresholds)
Error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-46-d8d6f0b546ca> in <module>()
10
11 import numpy as np
---> 12 from sklearn.metrics import det_curve
13
14 fpr, fnr, thresholds = det_curve(y_test['cEXT'], y_pred)
ImportError: cannot import name 'det_curve' from 'sklearn.metrics' (/usr/local/lib/python3.7/dist-packages/sklearn/metrics/__init__.py)
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Solution
Looks like some issue with a missing package. Try the following:
pip uninstall -v scikit-learn
pip install -v scikit-learn
This might install the related dependencies along with it.
Answered By - zephyr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.