Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dask_ml/model_selection/_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ def train_test_split(
test_size = 0.1

if train_size is None and test_size is not None:
train_size = 1 - test_size
train_size = round(1 - test_size, 6)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, the number 6 could be promoted to a named variable to avoid copy-and-paste bugs upon possible updates to this.

Also, I think for some users, the value 6 wouldn't be as effective, as it would for others. Perhaps, this warrants a consideration for introducing a configurable parameter. If such parameter is absent, some default value (eg, 6, as it has been the choice here) could be used as a fallback.

if test_size is None and train_size is not None:
test_size = 1 - train_size
test_size = round(1 - train_size, 6)

if options:
raise TypeError("Unexpected options {}".format(options))
Expand Down