Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sklearn set_config is erroring

I am facing an issue where the sklearn set_config is failing. I am using Google Colab and also it is failing on Jupyter Notebook as well. Even the code when copied from https://scikit-learn.org/stable/auto_examples/release_highlights/plot_release_highlights_0_23_0.html#sphx-glr-auto-examples-release-highlights-plot-release-highlights-0-23-0-py also failing with same error.

from sklearn import set_config
set_config(display='diagram')

Error: TypeError: set_config() got an unexpected keyword argument 'display'

Please suggest how to resolve this.

like image 218
Mayank Tripathi Avatar asked Jun 19 '20 21:06

Mayank Tripathi


1 Answers

You need to upgrade scikit-learn on colab, its version is 'v0.22.2.post1', while display parameter in set_config() function was introduced in v0.23.

!pip install --upgrade scikit-learn

Then, restart the runtime, display should work now.

like image 186
kHarshit Avatar answered Nov 03 '22 02:11

kHarshit