-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support of selecting different from subsets proportionately (#270)
* Use numpy to count the unique number of labels for efficiency * Add support of selection different cluster subsets proportionately * Add tests for the proportional selection * Fix the problem of when zero number of elements selected from the minority class * Add tests for imbalance case of multiple classes * Add testing data for imbalance cases * Reformat with black * Add data points to smallest cluster when not enough data points * Add test for checking the number of labels match the number of total data points * Ignore NotImplementedError in coverage report * Add typing hints for returns * Add typing hints
- Loading branch information
Showing
12 changed files
with
575 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -666,4 +666,3 @@ def select_from_cluster(self, arr, num_selected, cluster_ids=None): | |
) | ||
count += 1 | ||
return selected | ||
|
Oops, something went wrong.