iguanas.rule_scoring.PerformanceScorer

class iguanas.rule_scoring.PerformanceScorer(performance_func: Callable)[source]

Generates rule scores from a performance function.

Parameters
performance_funcCallable

The method/function to calculate the metric used to score the rules. Should have parameters y_true, y_pred and sample_weight.

fit(X_rules: iguanas.utils.typing.pandas.core.frame.DataFrame, y: iguanas.utils.typing.pandas.core.series.Series, sample_weight=None) iguanas.utils.typing.pandas.core.frame.DataFrame[source]

Generates rule scores from a weighting function.

Parameters
X_rulesPandasDataFrameType

The binary columns associated with the rules.

yPandasPandasSeriesType

The binary target column.

sample_weightPandasPandasSeriesType, optional

Row-wise sample_weights to apply. Defaults to None.

Returns
PandasDataFrameType

The rule scores applied to the dataset.