def __init__(self):
with pd.HDFStore("../input/train.h5", "r") as hfdata:
self.timestamp = 0
fullset = hfdata.get("train")
self.unique_timestamp = fullset["timestamp"].unique()
# Get a list of unique timestamps
# use the first half for training and
# the second half for the test set
n = len(self.unique_timestamp)
i = int(n/2)
timesplit = self.unique_timestamp[i]
self.n = n
self.unique_idx = i
self.train = fullset[fullset.timestamp < timesplit]
self.test = fullset[fullset.timestamp >= timesplit]
# Needed to compute final score
self.full = self.test.loc[:, ['timestamp', 'y']]
self.full['y_hat'] = 0.0
self.temp_test_y = None
kagglegym.py 文件源码
python
阅读 60
收藏 0
点赞 0
评论 0
评论列表
文章目录