Sklearn - StratifiedGroupKFold cannot be imported in JupyterNotebook Browser

Viewed 112

I have been having issues importing StratifiedGroupKFold using JupyterNotebook.

from sklearn.model_selection import StratifiedGroupKFold

ImportError: cannot import name 'StratifiedGroupKFold' from 'sklearn.model_selection'

The weird thing is that I can import the module when I launch JupyterServer and run the notebook in PyCharm.

How can that be and how do I get to run import it in the default browser?

2 Answers

May be you use a different environment in JupyterNotebook. Check your JupyterNotebook and pycharm environment, make sure they have the same environment

I guess there must be some conflicts with the versions. I'll highly recommend you to uninstall it and re-install it. This should resolve your bug.

Related