Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datasets) Add pathological partitioner #3623

Merged
merged 25 commits into from
Jul 12, 2024
Merged

Conversation

adam-narozniak
Copy link
Contributor

@adam-narozniak adam-narozniak commented Jun 17, 2024

Issue

There's no support for what is commonly known as a Pathological partitioner.

Description

PathologicalPartitioner (the version that does not take the distribution as an input) provides a way of creating partition IDs such that the number of unique classes is constrained to the number specified by users. Note that it does not imply that each class is divided evenly (see more in docs).

This method is used in our baselines in:

  • fedstar,
  • fedvssl,
  • heterofl,
  • niiid_bench.

Proposal

Provide an implementation of PathologicalPartitioner. For details on how the method works, please refer to the documentation and ask questions directly there.

Explanation

Note: if reproducing these images, they will look slightly different since a change that sorts the unique labels was applied after the images were generated.

Here's the visualization of the results that can be obtained using PathologicalPartitioner (not available in the docstrings but can help to understand the method):

comparison_pathological_partitioner_class_assignment_mode_2_10
comparison_pathological_partitioner_class_assignment_mode_2_20
comparison_pathological_partitioner_class_assignment_mode_3_10
comparison_pathological_partitioner_class_assignment_mode_3_20

@adam-narozniak adam-narozniak self-assigned this Jul 9, 2024
@adam-narozniak adam-narozniak marked this pull request as ready for review July 9, 2024 11:48
@adam-narozniak adam-narozniak changed the title feat(datasets) Add class contrained partitioner feat(datasets) Add pathological partitioner Jul 11, 2024
@jafermarq jafermarq merged commit 356e3f4 into main Jul 12, 2024
34 checks passed
@jafermarq jafermarq deleted the fds-add-class-constrained branch July 12, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants