module ‘sklearn’ has no attribute ‘cross_validation’

sklearn does not automatically import its subpackages. If you only imported via: import sklearn, then it won’t work. Import with import sklearn.cross_validation instead.

Further, sklearn.cross_validation will be deprecated in version 0.20. Use sklearn.model_selection.train_test_split instead.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)