Skip to content

Commit

Permalink
add base case
Browse files Browse the repository at this point in the history
  • Loading branch information
paxcema committed Apr 30, 2024
1 parent e86ae18 commit 9e2c2da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dataprep_ml/splitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def splitter(
train, dev, test = simple_split(data, pct_train, pct_dev, pct_test)

# Final assertions for time series
if min(len(train), len(dev)) < tss.get('window'):
if min(len(train), len(dev)) < tss.get('window', 1):
raise Exception(f"Dataset size is too small for the specified window size ({tss.get('window')})")

if min(len(train), len(dev), len(test)) < tss.get('horizon'):
if min(len(train), len(dev), len(test)) < tss.get('horizon', 1):
raise Exception(f"Dataset size is too small for the specified horizon size ({tss.get('horizon')})")

return {"train": train, "test": test, "dev": dev, "stratified_on": stratify_on}
Expand Down

0 comments on commit 9e2c2da

Please sign in to comment.