Error with boston load using cross validation import train_test_split



0
I downloaded Python, Anaconda, Pycharm, and attempted to run the code at the bottom.  I received an error involving the "sklearn.cross_validation import train_test_split" line of code.  Do you know why this is working in Jupyter Notebook but not updated versions of (Python, Anaconda, Pycharm)?

 

 

"This module was deprecated in version 0.18 in favor of the "
              "model_selection module into which all the refactored classes "
              "and functions are moved. Also note that the interface of the "
              "new CV iterators are different from that of this module. "
              "This module will be removed in 0.20.", DeprecationWarning)




Below is the code I used to generate the error above.




from sklearn.datasets import load_boston
#from sklearn.cross_validation import train_test_split  #<---There is an issue with this
import pandas as pd

bhData = load_boston()
featureData=bhData.data
columnNames=bhData.feature_names
modellingData = pd.DataFrame(featureData,columns=columnNames)
modellingData['target'] = bhData.target
modellingData_Train,modellingData_Test = train_test_split(modellingData,test_size=0.30)

modellingData_Train.head()

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password