iguanas.rule_scoring.ConstantScaler

class iguanas.rule_scoring.ConstantScaler(limit: int)[source]

Scales rule scores using the formula (depending on the sign of the rule scores):

For negative scores: x_scaled = (limit / x_min) * x

For positive scores: x_scaled = (limit / x_max) * x

where the limit parameter is specified in the class constructor. Note that the scores are also converted to int.

Parameters
limitint

The limit to apply when scaling the scores.

fit(rule_scores: iguanas.utils.typing.pandas.core.series.Series) iguanas.utils.typing.pandas.core.series.Series[source]

Scales the rule scores.

Parameters
rule_scoresPandasSeriesType

Rule scores to scale.

Returns
PandasSeriesType

The scaled rule scores.