mlrl.common.cython.feature_sampling module

@author: Michael Rapp (michael.rapp.ml@gmail.com)

class mlrl.common.cython.feature_sampling.FeatureSamplingWithoutReplacementConfig

Bases: object

Allows to configure a method for sampling features without replacement.

get_num_retained() int

Returns the number of trailing features that are always included in a sample.

Returns:

The number of trailing features that are always included in a sample

get_sample_size() float

Returns the fraction of features that are included in a sample.

Returns:

The fraction of features that are included in a sample

set_num_retained(num_retained: int) FeatureSamplingWithoutReplacementConfig

Sets the number fo trailing features that should always be included in a sample.

Parameters:

num_retained – The number of trailing features that should always be included in a sample. Must be at least 0

Returns:

A FeatureSamplingWithoutReplacementConfig that allows further configuration of the method for sampling features

set_sample_size(sample_size: float) FeatureSamplingWithoutReplacementConfig

Sets the fraction of features that should be included in a sample.

Parameters:

sample_size – The fraction of features that should be included in a sample, e.g., a value of 0.6 corresponds to 60 % of the available features. Must be in (0, 1) or 0, if the default sample size floor(log2(numFeatures - 1) + 1) should be used

Returns:

A FeatureSamplingWithoutReplacementConfig that allows further configuration of the method for sampling features