uniformdistributionshuffler
uniformdistributionshuffler ¶
Module for the UniformDistributionShuffler and helper methods
Classes¶
UniformDistributionShuffler ¶
Bases: DataShuffler
A shuffler which generates uniform distributed indexes
Parameters¶
class_attr: str Classttribute name of the datainfo mode: str How the target amount of each class should be calculated such that they are evenly distributed (max, min, avg)
Source code in niceml/data/datashuffler/uniformdistributionshuffler.py
Functions¶
Functions¶
check_mode ¶
Checks if mode is available otherwise raises ModeNotImplementedError
Source code in niceml/data/datashuffler/uniformdistributionshuffler.py
classdict_to_indexes ¶
Uses the class dict to return a list of indexes
Parameters¶
class_dict: Dict[Any, List[int]] Contains for each class the list of indexes referring to it mode: str How the target amount of each class should be calculated such that they are evenly distributed (max, min, avg)
Returns¶
A shuffled list of indexes (each index can occur multiple times)