Skip to content

Commit

Permalink
Update divider renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-narozniak committed May 22, 2024
1 parent a2bfd22 commit 77d3497
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions datasets/flwr_datasets/preprocessor/divider.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class Divider:
>>> # Assuming there is a dataset_dict of type `DatasetDict`
>>> # dataset_dict is {"train": train-data, "test": test-data}
>>> resplitter = Divider(
>>> divider = Divider(
>>> divide_config={
>>> "train": 0.8,
>>> "valid": 0.2,
>>> }
>>> divide_split="train",
>>> )
>>> new_dataset_dict = resplitter(dataset_dict)
>>> new_dataset_dict = divider(dataset_dict)
>>> # new_dataset_dict is
>>> # {"train": 80% of train, "valid": 20% of train, "test": test-data}
Expand All @@ -83,7 +83,7 @@ class Divider:
>>> # Assuming there is a dataset_dict of type `DatasetDict`
>>> # dataset_dict is {"train": train-data, "test": test-data}
>>> resplitter = Divider(
>>> divider = Divider(
>>> divide_config={
>>> "train": {
>>> "train": 0.8,
Expand All @@ -92,7 +92,7 @@ class Divider:
>>> "test": {"test-a": 0.4, "test-b": 0.6 }
>>> }
>>> )
>>> new_dataset_dict = resplitter(dataset_dict)
>>> new_dataset_dict = divider(dataset_dict)
>>> # new_dataset_dict is
>>> # {"train": 80% of train, "valid": 20% of train,
>>> # "test-a": 40% of test, "test-b": 60% of test}
Expand Down
4 changes: 2 additions & 2 deletions datasets/flwr_datasets/preprocessor/divider_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
),
],
)
class TestDivideResplitter(unittest.TestCase):
class TestDivider(unittest.TestCase):
"""Divider tests."""

divide_config: Union[
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_resplitting_correct_new_split_sizes(self) -> None:


class TestDividerIncorrectUseCases(unittest.TestCase):
"""Resplitter tests."""
"""Divider tests."""

def setUp(self) -> None:
"""Set up the dataset with 3 splits for tests."""
Expand Down

0 comments on commit 77d3497

Please sign in to comment.