Search code examples
pythonpython-3.xscikit-learnlinear-regressiondata-analysis

I updated scikit.learn but I have still get this error: ModuleNotFoundError: No module named 'sklearn.cross_validation'


I want to make linear regression and I have problem about scikit.learn. I updated from 20.1 to 20.2 but I have still get ModuleNotFoundError.


Solution

  • The cross-validation functionality has been moved to model_selection. To access it's functionality you may try:

    from sklearn.model_selection import cross_validate                                          
    from sklearn.model_selection import cross_val_predict                          
    from sklearn.model_selection import cross_val_score 
    from sklearn.model_selection import train_test_split
    

    See docs and examples at Cross-validation