mlrl.common.config.parameters module¶
Author: Michael Rapp (michael.rapp.ml@gmail.com)
Provides utilities that ease the configuration of rule learning algorithms.
- class mlrl.common.config.parameters.FeatureBinningParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for feature binning.
- class mlrl.common.config.parameters.FeatureSamplingParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for feature sampling.
- OPTION_NUM_RETAINED = 'num_retained'¶
- class mlrl.common.config.parameters.FloatParameter(name: str, description: str, mixin: type)¶
Bases:
NumericalParameter,ABCAn abstract base class for all parameters of a rule learning algorithm that allow to set a floating point value.
- class mlrl.common.config.parameters.GlobalPruningParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for pruning entire rules.
- AGGREGATION_FUNCTION_ARITHMETIC_MEAN = 'avg'¶
- AGGREGATION_FUNCTION_MAX = 'max'¶
- AGGREGATION_FUNCTION_MIN = 'min'¶
- GLOBAL_PRUNING_POST = 'post-pruning'¶
- GLOBAL_PRUNING_PRE = 'pre-pruning'¶
- OPTION_AGGREGATION_FUNCTION = 'aggregation'¶
- OPTION_INTERVAL = 'interval'¶
- OPTION_MIN_IMPROVEMENT = 'min_improvement'¶
- OPTION_MIN_RULES = 'min_rules'¶
- OPTION_NUM_PAST = 'num_past'¶
- OPTION_NUM_RECENT = 'num_recent'¶
- OPTION_REMOVE_UNUSED_RULES = 'remove_unused_rules'¶
- OPTION_STOP_INTERVAL = 'stop_interval'¶
- OPTION_UPDATE_INTERVAL = 'update_interval'¶
- class mlrl.common.config.parameters.InstanceSamplingParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for instance sampling.
- class mlrl.common.config.parameters.IntParameter(name: str, description: str, mixin: type)¶
Bases:
NumericalParameter,ABCAn abstract base class for all parameters of a rule learning algorithm that allow to set an integer value.
- class mlrl.common.config.parameters.NominalParameter(name: str, description: str)¶
-
An abstract base class for all nominal parameters of a rule learning algorithm that allow to set one out of a set of predefined values.
- class Value(name: str, mixin: type, options: set[str] | None, description: str | None)¶
Bases:
objectA value that can be set for a nominal parameter.
- add_value(name: str, mixin: type, options: set[str] | None = None, description: str | None = None)¶
Adds a new value to the parameter.
- Parameters:
name – The name of the value to be added
mixin – The type of the mixin that must be implemented by a rule learner to support the value
options – A set that contains the names of additional options that may be specified or None, if no additional options are available
description – A textual description of the value
- Returns:
The parameter itself
- as_argument(config_type: type) Argument | None¶
Creates and returns an Argument from this parameter, if it is supported by a configuration of a specific type.
- Parameters:
config_type – The type of the configuration
- Returns:
The Argument that has been created or None, if it is not supported by a configuration of the given type
- configure(config, value)¶
Configures a rule learner depending on this parameter.
- Parameters:
config – The configuration to be modified
value – The value to be set
- class mlrl.common.config.parameters.NumericalParameter(name: str, description: str, mixin: type, numeric_type: type)¶
-
An abstract base class for all parameters of a rule learning algorithm that allow to set a numerical value.
- as_argument(config_type: type) Argument | None¶
Creates and returns an Argument from this parameter, if it is supported by a configuration of a specific type.
- Parameters:
config_type – The type of the configuration
- Returns:
The Argument that has been created or None, if it is not supported by a configuration of the given type
- configure(config, value)¶
Configures a rule learner depending on this parameter.
- Parameters:
config – The configuration to be modified
value – The value to be set
- class mlrl.common.config.parameters.OutputSamplingParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for output sampling.
- OUTPUT_SAMPLING_ROUND_ROBIN = 'round-robin'¶
- class mlrl.common.config.parameters.ParallelPredictionParameter¶
Bases:
NominalParameterA parameter that allows to configure whether predictions for different examples should be obtained in parallel or not.
- class mlrl.common.config.parameters.ParallelRuleRefinementParameter¶
Bases:
NominalParameterA parameter that allows to configure whether potential refinements of rules should be searched for in parallel or not.
- class mlrl.common.config.parameters.ParallelStatisticUpdateParameter¶
Bases:
NominalParameterA parameter that allows to configure whether the statistics for different examples should be updated in parallel or not.
- class mlrl.common.config.parameters.Parameter(name: str, description: str)¶
Bases:
ABCAn abstract base class for all parameters of a rule learning algorithm.
- abstractmethod as_argument(config_type: type) Argument | None¶
Creates and returns an Argument from this parameter, if it is supported by a configuration of a specific type.
- Parameters:
config_type – The type of the configuration
- Returns:
The Argument that has been created or None, if it is not supported by a configuration of the given type
- abstractmethod configure(config, value)¶
Configures a rule learner depending on this parameter.
- Parameters:
config – The configuration to be modified
value – The value to be set
- class mlrl.common.config.parameters.PartitionSamplingParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for creating a holdout set.
- OPTION_HOLDOUT_SET_SIZE = 'holdout_set_size'¶
- PARTITION_SAMPLING_RANDOM = 'random'¶
- class mlrl.common.config.parameters.PostOptimizationParameter¶
Bases:
NominalParameterA parameter that allows to configure the method that should be used for post-optimization of a previously learned model.
- OPTION_NUM_ITERATIONS = 'num_iterations'¶
- OPTION_REFINE_HEADS = 'refine_heads'¶
- POST_OPTIMIZATION_SEQUENTIAL = 'sequential'¶
- class mlrl.common.config.parameters.RandomStateParameter¶
Bases:
IntParameterA parameter that allows to configure the seed to be used by random number generators.
- class mlrl.common.config.parameters.RuleInductionParameter¶
Bases:
NominalParameterA parameter that allows to configure the algorithm to be used for the induction of individual rules.
- OPTION_BEAM_WIDTH = 'beam_width'¶
- OPTION_MAX_CONDITIONS = 'max_conditions'¶
- OPTION_MAX_HEAD_REFINEMENTS = 'max_head_refinements'¶
- OPTION_MIN_COVERAGE = 'min_coverage'¶
- OPTION_MIN_SUPPORT = 'min_support'¶
- OPTION_RECALCULATE_PREDICTIONS = 'recalculate_predictions'¶
- RULE_INDUCTION_TOP_DOWN_BEAM_SEARCH = 'top-down-beam-search'¶
- RULE_INDUCTION_TOP_DOWN_GREEDY = 'top-down-greedy'¶
- class mlrl.common.config.parameters.RulePruningParameter¶
Bases:
NominalParameterA parameter that allows to configure the strategy to be used for pruning individual rules.
- RULE_PRUNING_IREP = 'irep'¶
- class mlrl.common.config.parameters.SizeStoppingCriterionParameter¶
Bases:
IntParameterA parameter that allows to configure the maximum number of rules to be induced.
- class mlrl.common.config.parameters.TimeStoppingCriterionParameter¶
Bases:
IntParameterA parameter that allows to configure the duration in seconds after which the induction of rules should be canceled.