def get_kfold_bydate(self, df, n_folds = 10):
df.sort_values(by = ['time_date','time_id','start_district_id'], axis = 0, inplace = True)
df.reset_index(drop=True, inplace = True)
kf = KFold(df.shape[0], n_folds= n_folds, shuffle=False)
for train_index, test_index in kf:
print("TRAIN:", train_index, "TEST:", test_index)
return kf
splittrainvalidation.py 文件源码
python
阅读 34
收藏 0
点赞 0
评论 0
评论列表
文章目录