Skip to content

Commit

Permalink
newtest
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannZe committed Dec 19, 2023
1 parent 5c837ee commit bae9874
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sklearn_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class MonthlySplit(BaseCrossValidator):
To use the index as column just set `time_col` to `'index'`.
"""

def __init__(self, time_col='index'): # noqa: D107
self.time_col = time_col

def get_n_splits(self, X, y=None, groups=None):
"""Return the number of splitting iterations in the cross-validator.
Expand Down Expand Up @@ -196,7 +199,7 @@ def split(self, X, y=None, groups=None):
idx_test : ndarray
The testing set indices for that split.
"""
newX = X.copy()
newX = X.rest_index()
n_splits = self.get_n_splits(newX, y, groups)
Xtodivide = newX.sort_values(
self.time_col
Expand Down

0 comments on commit bae9874

Please sign in to comment.