I want to use scikitlearn in my notebook. I installed it by this code:

!pip install scikit-plot from scikitplot.estimators import plot_feature_importances from scikitplot.metrics import plot_confusion_matrix, plot_roc 

The installation was correct, but I get the following error when I try to use the packages:

enter image description here

My lecturer give us a "workspace" via wlan, so I don't work local. Could that be the reason? I would be so thankful, if someone can help me. Thank you in advance!

2

4 Answers

I removed the "!" and it worked for me. Try

pip install scikit-plot 

I've had multiple conflicts with the scikit-plot package, given that this project is not maintained since 2018, I moved to a well-maintained package that gives me the same capabilities and support backward compatibility ()

Seems like the problem is with the installed versions in the workspace, so yes, the problem is the workspace. Try to uninstall the scikit-learn framework and reinstall it again using only one version of pip to evade version incompatibility. If it does not work, you could try reinstalling all the libraries of the workspace from 0 (or just create a new workspace).

Also, you have another option, and it is to not use the scikit-plot library to do the 3 plots, and use matplotlib.pyplot to plot them.

Example of feature plot, confusion matrix plot ,roc curve plot

5

instead of '!' you can use '%' like

%pip install scikit-plot will work smoothly with any other packages too

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.