Issue
I have been trying to get the classification report in the form of a dictionary. So according to the scikit-learn 0.20 documentation, I do:
from sklearn import metrics
rep = metrics.classification_report(y_true, y_pred, output_dict=True)
But get an error saying
TypeError: classification_report() got an unexpected keyword argument 'output_dict'
The scikit-learn module in my machine was initially 0.19.1 but even after updating it to 0.20, the same error message shows.
Solution
This error should not show up as long as you have scikit-learn 0.20.0 installed. If you are trying this in a jupyter notebook, make sure the correct version reflects in your notebook using:
import sklearn
print(sklearn.__version__)
If you've upgraded scikit-learn but jupyter shows the wrong version of the package, make sure jupyter is installed in your current environment (and restart jupyter in a new terminal).
Answered By - spundian
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.