mlrl.common.cython.partition_sampling module¶
@author: Michael Rapp (michael.rapp.ml@gmail.com)
- class mlrl.common.cython.partition_sampling.ExampleWiseStratifiedBiPartitionSamplingConfig¶
Bases:
object
Allows to configure a method for partitioning the available training examples into a training set and a holdout set using stratification, where distinct label vectors are treated as individual classes.
- get_holdout_set_size() float ¶
Returns the fraction of examples that are included in the holdout set.
- Returns:
The fraction of examples that are included in the holdout set
- set_holdout_set_size(holdout_set_size: float) ExampleWiseStratifiedBiPartitionSamplingConfig ¶
Sets the fraction of examples that should be included in the holdout set.
- Parameters:
holdout_set_size – The fraction of examples that should be included in the holdout set, e.g., a value of 0.6 corresponds to 60 % of the available examples. Must be in (0, 1)
- Returns:
An ExampleWiseStratifiedBiPartitionSamplingConfig that allows further configuration of the method for partitioning the available training examples into a training set and a holdout set
- class mlrl.common.cython.partition_sampling.LabelWiseStratifiedBiPartitionSamplingConfig¶
Bases:
object
Allows to configure a method for partitioning the available training examples into a training set and a holdout set using stratification, such that for each label the proportion of relevant and irrelevant examples is maintained.
- get_holdout_set_size() float ¶
Returns the fraction of examples that are included in the holdout set.
- Returns:
The fraction of examples that are included in the holdout set
- set_holdout_set_size(holdout_set_size: float) LabelWiseStratifiedBiPartitionSamplingConfig ¶
Sets the fraction of examples that should be included in the holdout set.
- Parameters:
holdout_set_size – The fraction of examples that should be included in the holdout set, e.g., a value of 0.6 corresponds to 60 % of the available examples. Must be in (0, 1)
- Returns:
An LabelWiseStratifiedBiPartitionSamplingConfig that allows further configuration of the method for partitioning the available training examples into a training set and a holdout set
- class mlrl.common.cython.partition_sampling.RandomBiPartitionSamplingConfig¶
Bases:
object
Allows to configure a method for partitioning the available training examples into a training set and a holdout set that randomly splits the training examples into two mutually exclusive sets.
- get_holdout_set_size() float ¶
Returns the fraction of examples that are included in the holdout set.
- Returns:
The fraction of examples that are included in the holdout set
- set_holdout_set_size(holdout_set_size: float) RandomBiPartitionSamplingConfig ¶
Sets the fraction of examples that should be included in the holdout set.
- Parameters:
holdout_set_size – The fraction of examples that should be included in the holdout set, e.g., a value of 0.6 corresponds to 60 % of the available examples. Must be in (0, 1)
- Returns:
A RandomBiPartitionSamplingConfig that allows further configuration of the method for partitioning the available training examples into a training set and a holdout set