from sklearn.utils import shuffle # 导入乱序工具 df_train = shuffle(df_train) # 乱序训练集 df_test = shuffle(df_test) # 乱序测试集