iguanas.rule_selection
.CorrelatedFilter¶
- class iguanas.rule_selection.CorrelatedFilter(correlation_reduction_class: iguanas.correlation_reduction.agglomerative_clustering_reducer.AgglomerativeClusteringReducer, rule_descriptions=None)[source]¶
Filters correlated rules based on a correlation reduction class (see the correlation_reduction sub-package).
- Parameters
- correlation_reduction_classAgglomerativeClusteringReducer
Instatiated class from the correlation_reduction sub-package.
- rule_descriptionsPandasDataFrameType, optional
The standard performance metrics dataframe associated with the rules (if available). Defaults to None.
- Attributes
- rules_to_keepList[str]
List of rules which remain after correlated rules have been removed.
- fit(X_rules: iguanas.utils.typing.pandas.core.frame.DataFrame, **kwargs) → None[source]¶
Calculates the uncorrelated rules(using the correlation reduction class).
- Parameters
- X_rulesPandasDataFrameType
The binary columns of the rules applied to a dataset.
- **kwargsdict
Any keyword arguments to pass to the correlation reduction class’s .fit() method
- transform(X_rules: iguanas.utils.typing.pandas.core.frame.DataFrame) → iguanas.utils.typing.pandas.core.frame.DataFrame[source]¶
Keeps only the uncorrelated rules in X_rules and rule_descriptions.
- Parameters
- X_rulesPandasDataFrameType
The binary columns of the rules applied to a dataset.
- Returns
- PandasDataFrameType
The binary columns of the uncorrelated rules.
- fit_transform(X_rules: iguanas.utils.typing.pandas.core.frame.DataFrame, **kwargs) → iguanas.utils.typing.pandas.core.frame.DataFrame[source]¶
Calculates the uncorrelated rules(using the correlation reduction class) then keeps only these uncorrelated rules in X_rules and rule_descriptions.
- Parameters
- X_rulesPandasDataFrameType
The binary columns of the rules applied to a dataset.
- **kwargsdict
Any keyword arguments to pass to the correlation reduction class’s .fit() method.
- Returns
- PandasDataFrameType
The binary columns of the uncorrelated rules.