Skip to content

Commit

Permalink
Set split proportions to None if split column is provided
Browse files Browse the repository at this point in the history
Issue #198
  • Loading branch information
sambujangfofana committed Apr 26, 2024
1 parent 70e79f2 commit 69405a7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions zamba/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,13 @@ def validate_filepaths_and_labels(cls, values):
)

elif values["split_proportions"] is not None:
logger.warning(
"Labels contains split column yet split_proportions are also provided. Split column in labels takes precedence."
)
# set to None for clarity in final configuration.yaml
values["split_proportions"] = None
# Check to see if split_proportions contains the default values
if values.get("split_proportions") != {"train": 3, "val": 1, "holdout": 1}:
logger.warning(
"Labels contains split column yet split_proportions are also provided. Split column in labels takes precedence."
)
# set to None for clarity in final configuration.yaml
values["split_proportions"] = None

# error if labels are entirely null
null_labels = labels.label.isnull()
Expand Down

0 comments on commit 69405a7

Please sign in to comment.