Skip to content Skip to sidebar Skip to footer

Importerror: Cannot Import Name 'stratifiedgroupkfold' From 'sklearn.model_selection'

I'm getting an ImportError when I try to use the StratifiedGroupKFold split from sklearn. I noticed to use it the nightly build is required and I've installed it, yet I get the err

Solution 1:

Rather than trying to install nightly version, I would go for installing from the source. See instructions here

BTW, I don't see any issues for me, when importing StratifiedGroupKFold from the dev version

[ins] In [2]: import sklearn                                                                                                                                           
sklearn.__version__

[ins] In [3]: sklearn.__version__                                                                                                                                      
Out[3]: '1.0.dev0'

[ins] In [4]: import numpy as np 
         ...: from sklearn.model_selection import StratifiedGroupKFold                                                                                                 

[ins] In [5]:  

Post a Comment for "Importerror: Cannot Import Name 'stratifiedgroupkfold' From 'sklearn.model_selection'"