mlrl.common.testbed.experiments.output.characteristics.model.statistics module

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

Provides classes that store statistics of rule models.

class mlrl.common.testbed.experiments.output.characteristics.model.statistics.BodyStatistics(num_numerical_leq: int = 0, num_numerical_gr: int = 0, num_ordinal_leq: int = 0, num_ordinal_gr: int = 0, num_nominal_eq: int = 0, num_nominal_neq: int = 0)

Bases: object

Stores statistics of a rule’s body.

Attributes:

num_numerical_leq: The number of numerical conditions using the <= operator num_numerical_gr: The number of numerical conditions using the > operator num_ordinal_leq: The number of ordinal conditions using the <= operator num_ordinal_gr: The number of ordinal conditions using the > operator num_nominal_eq: The number of nominal conditions using the == operator num_nominal_neq: The number of nominal conditions using the != operator

property fraction_nominal_eq: float

The fraction of nominal conditions using the == operator.

property fraction_nominal_neq: float

The fraction of nominal conditions using the != operator.

property fraction_numerical_gr: float

The fraction of numerical conditions using the > operator.

property fraction_numerical_leq: float

The fraction of numerical conditions using the <= operator.

property fraction_ordinal_gr: float

The fraction of ordinal conditions using the > operator.

property fraction_ordinal_leq: float

The fraction of ordinal conditions using the <= operator.

property num_conditions: int

The total number of conditions.

property num_nominal: int

The number of nominal conditions, regardless of their operator.

num_nominal_eq: int = 0
num_nominal_neq: int = 0
property num_numerical: int

The number of numerical conditions, regardless of their operator.

num_numerical_gr: int = 0
num_numerical_leq: int = 0
property num_ordinal: int

The number of ordinal conditions, regardless of their operator.

num_ordinal_gr: int = 0
num_ordinal_leq: int = 0
class mlrl.common.testbed.experiments.output.characteristics.model.statistics.HeadStatistics(num_positive_predictions: int = 0, num_negative_predictions: int = 0)

Bases: object

Stores statistics of a rule’s head.

Attributes:

num_positive_predictions: The number of positive predictions num_negative_predictions: The number of negative predictions

property fraction_negative_predictions: float

The fraction of negative predictions.

property fraction_positive_predictions: float

The fraction of positive predictions.

num_negative_predictions: int = 0
num_positive_predictions: int = 0
property num_predictions: int

The total number of predictions.

class mlrl.common.testbed.experiments.output.characteristics.model.statistics.RuleModelStatistics(default_rule_statistics: RuleStatistics | None = None, rule_statistics: list[RuleStatistics] = <factory>)

Bases: object

Stores statistics of a rule model.

Attributes:

default_rule_statistics: The statistics of the default rule, if any rule_statistics: A list that stores the statistics all other rules

default_rule_statistics: RuleStatistics | None = None
property has_default_rule: bool

True, if the model has a default rule, False otherwise.

property max_conditions: int

The maximum number of conditions per rule.

property max_predictions: int

The maximum number of predictions per rule.

property min_conditions: int

The minimum number of conditions per rule.

property min_predictions: int

The minimum number of predictions per rule.

property num_rules: int

The number of rules.

rule_statistics: list[RuleStatistics]
class mlrl.common.testbed.experiments.output.characteristics.model.statistics.RuleStatistics(body_statistics: BodyStatistics = <factory>, head_statistics: HeadStatistics = <factory>)

Bases: object

Stores statistics of a rule.

Attributes:

body_statistics: The statistics of the rule’s body head_statistics: The statistics of the rule’s head

body_statistics: BodyStatistics
head_statistics: HeadStatistics