mlrl.common.cython.output_sampling module¶
@author: Michael Rapp (michael.rapp.ml@gmail.com)
- class mlrl.common.cython.output_sampling.OutputSamplingWithoutReplacementConfig¶
Bases:
objectAllows to configure a method for sampling outputs without replacement.
- get_max_samples() int¶
Returns the maximum number of outputs that are included in a sample.
- Returns:
The maximum number of outputs that are included in a sample
- get_min_samples() int¶
Returns the minimum number of outputs that are included in a sample.
- Returns:
The minimum number of outputs that are included in a sample
- get_sample_size() float¶
Returns the fraction of outputs that are included in a sample.
- Returns:
The fraction of outputs that are included in a sample
- set_max_samples(max_samples: int) OutputSamplingWithoutReplacementConfig¶
Sets the maximum number of outputs that should be included in a sample.
- Parameters:
max_samples – The maximum number of outputs that should be included in a sample. Must be at least get_min_samples() or 0, if the number of outputs should not be restricted
- Returns:
An OutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling outputs
- set_min_samples(min_samples: int) OutputSamplingWithoutReplacementConfig¶
Sets the minimum number of outputs that should be included in a sample.
- Parameters:
min_samples – The minimum number of outputs that should be included in a sample. Must be at least 1
- Returns:
An OutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling outputs
- set_sample_size(sample_size: float) OutputSamplingWithoutReplacementConfig¶
Sets the fraction of outputs that should be included in a sample.
- Parameters:
sample_size – The fraction of outputs that should be included in a sample, e.g., a value of 0.6 corresponds to 60 % of the available outputs. Must be in (0, 1)
- Returns:
An OutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling outputs