我想在 Google Colab 中使用 sklearn.metrics plot_confusion_matrix。它带有 sklearn 0.22 的最新稳定更新。
https://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html#sphx-glr-auto-examples-model-selection-plot-confusion-matrix-py
我试过这个 Make colab use the latest installation of a library
但最后它显示sklearn的版本仍然是0.21。
谢谢
最佳答案
我像您在图像开始时所做的那样从 colab 卸载了 sklearn,然后重新安装了它,并按照 sklearn 文档中提到的那样更新它。我使用的代码如下:
!pip uninstall scikit-learn -y
!pip install -U scikit-learn
在我检查我的版本是否更新后:import sklearn
sklearn.__version__
'0.24.1'
我希望能帮到你!
关于python - 如何在 Google Colab 中更新 scikit-learn?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59339251/