splittrainvalidation.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:Supply-demand-forecasting 作者: LevinJ 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号