Skip to content

Commit

Permalink
use self.date_idx for selecting train_idx and test_idx
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertraus committed Apr 9, 2021
1 parent 7ac6764 commit a094633
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def split(self, X, y=None, groups=None):
for train_start, train_end, test_start, test_end in split_idx:

train_idx = dates[(dates[self.date_idx] > days[train_start])
& (dates.date <= days[train_end])].index
test_idx = dates[(dates.date > days[test_start])
& (dates.date <= days[test_end])].index
& (dates[self.date_idx] <= days[train_end])].index
test_idx = dates[(dates[self.date_idx] > days[test_start])
& (dates[self.date_idx] <= days[test_end])].index
if self.shuffle:
np.random.shuffle(list(train_idx))
yield train_idx.to_numpy(), test_idx.to_numpy()
Expand Down

0 comments on commit a094633

Please sign in to comment.