1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-09 22:10:56 +08:00

Fix bugs for models.

This commit is contained in:
lwwang1995
2020-12-07 19:50:00 +08:00
committed by you-n-g
parent 4a748525bc
commit 70fb760830
2 changed files with 8 additions and 6 deletions

View File

@@ -238,7 +238,7 @@ class TSDataSampler:
self.start_idx, self.end_idx = self.data.index.slice_locs(start=pd.Timestamp(start), end=pd.Timestamp(end))
# self.index_link = self.build_link(self.data)
self.idx_df, self.idx_map = self.build_index(self.data)
self.idx_arr = np.array(self.idx_df.values, dtype=np.float64) # for better performance
self.idx_arr = np.array(self.idx_df.values, dtype=np.float64) # for better performance
def get_index(self):
"""
@@ -368,7 +368,6 @@ class TSDataSampler:
else:
indices = self._get_indices(*self._get_row_col(idx))
# 1) for better performance, use the last nan line for padding the lost date
# 2) In case of precision problems. We use np.float64. # TODO: I'm not sure if whether np.float64 will result in
# precision problems. It will not cause any problems in my tests at least