iguanas.rule_scoring.RandomForestScorer

class iguanas.rule_scoring.RandomForestScorer(*args, **kwargs)[source]

Generates rule scores from the feature importance of a trained Random Forest model.

Parameters
*argstuple, optional

Positional arguments associated with Sklearn’s RandomForestClassifier() class constructor.

**kwargstuple, optional

Keyword arguments associated with Sklearn’s RandomForestClassifier() class constructor.

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 the feature importance of a trained Random Forest model.

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.