Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i'm getting the above error how to resolve it.

What I have tried:

I have updated my sckit-learn but still landed up in the same error
Posted
Updated 14-Aug-22 6:45am
Comments
Richard MacCutchan 24-Oct-18 11:34am    
I guess you are trying to import a module into your Python code. However, without more information it is anyone's guess. Have you checked that sklearn exists in the correct library and/or that module is part of the package?
Member 14022594 24-Oct-18 11:47am    
yes everything i checked everything is fine
Member 14022594 24-Oct-18 11:48am    
model_selection is working fine but cross_validation im getting the error
Richard MacCutchan 24-Oct-18 12:08pm    
Sorry but you have not provided any useful information that would give us any clue what the problem is.

For Sklearn 18 version import this:
"from sklearn.cross_validation import KFold"

For sklearn 20 import this:
"from sklearn.model_selection import KFold"
 
Share this answer
 
 
Share this answer
 
Comments
mahdi javahery 16-Aug-23 23:06pm    
Hi I have very errors! When I try to install the scikit-learn, How can I solve this problems?

Error text:Error:Exception:
Traceback (most recent call lost): File "C:\Users\mahdi\AppData\Roaming\Python\Python311\site-packages\pip\_vendor\urllib3\response.py" , line 561, in read
data = self._fp_read(amt) if not fp_closed else b""



And this error has very addresses like this....
Please help me solve this error
Richard MacCutchan 17-Aug-23 3:20am    
I have no idea what that means, and this is not the place for a new question. Please open a new question and provide proper details of your code and the error.
cross_validation is no longer supported. Use only sklearn.model_selection from now on.
 
Share this answer
 
Comments
Member 14815208 27-Apr-20 15:29pm    
thank you
however the "cross_validation" name is now deprecated and was replaced by "model_selection" inside the new anaconda version.
Therefor you might get a warning of even an error.
To avoid this, you just need to replace:

from sklearn.cross_validation import train_test_split
to

from sklearn.model_selection import train_test_split
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900