Skip to content

Commit a094633

Browse files
committed
use self.date_idx for selecting train_idx and test_idx
1 parent 7ac6764 commit a094633

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def split(self, X, y=None, groups=None):
5050
for train_start, train_end, test_start, test_end in split_idx:
5151

5252
train_idx = dates[(dates[self.date_idx] > days[train_start])
53-
& (dates.date <= days[train_end])].index
54-
test_idx = dates[(dates.date > days[test_start])
55-
& (dates.date <= days[test_end])].index
53+
& (dates[self.date_idx] <= days[train_end])].index
54+
test_idx = dates[(dates[self.date_idx] > days[test_start])
55+
& (dates[self.date_idx] <= days[test_end])].index
5656
if self.shuffle:
5757
np.random.shuffle(list(train_idx))
5858
yield train_idx.to_numpy(), test_idx.to_numpy()

0 commit comments

Comments
 (0)