【发布时间】:2017-12-20 07:43:44
【问题描述】:
我已经用下面的代码得到了训练集和测试集的索引。
df = pandas.read_pickle(filepath + filename)
kf = KFold(n_splits = n_splits, shuffle = shuffle, random_state =
randomState)
result = next(kf.split(df), None)
#train can be accessed with result[0]
#test can be accessed with result[1]
我想知道是否有更快的方法将它们分别与我检索到的行索引分成 2 个数据帧。
【问题讨论】:
标签: python pandas scikit-learn