ModuleNotFoundError: No module named ‘sklearn.cross_validation’
导入 sklearn.cross_validation 会报错,这是版本更新之后,命名改变的缘故。现在应该使用 sklearn.model_selection from sklearn.model_selection import train_test_split 就可以成功 # 1. Importing the libraries import numpy as np import pandas as pd # 2. Importing dataset dataset = pd.read_csv('Data.csv') # read csv file X = dataset.iloc[:
用户评论