FeatureLabelCorrelationChange#

class FeatureLabelCorrelationChange[source]#

Return the Predictive Power Score of all features, in order to estimate each feature’s ability to predict the label.

The PPS represents the ability of a feature to single-handedly predict another feature or label. In this check, we specifically use it to assess the ability of each feature to predict the label. A high PPS (close to 1) can mean that this feature’s success in predicting the label is actually due to data leakage - meaning that the feature holds information that is based on the label to begin with.

When we compare train PPS to test PPS, A high difference can strongly indicate leakage, as a feature that was “powerful” in train but not in test can be explained by leakage in train that does not affect a new dataset.

Uses the ppscore package - for more info, see https://github.com/8080labs/ppscore

Parameters
ppscore_paramsdict , default: None

dictionary of additional parameters for the ppscore predictor function

n_top_featuresint , default: 5

Number of features to show, sorted by the magnitude of difference in PPS

random_stateint , default: None

Random state for the ppscore.predictors function

min_pps_to_show: float, default 0.05

Minimum PPS to show a class in the graph

__init__(ppscore_params=None, n_top_features: int = 5, random_state: Optional[int] = None, min_pps_to_show: float = 0.05, **kwargs)[source]#
__new__(*args, **kwargs)#

Methods

FeatureLabelCorrelationChange.add_condition(...)

Add new condition function to the check.

FeatureLabelCorrelationChange.add_condition_feature_pps_difference_less_than([...])

Add condition - difference between train dataset feature pps and test dataset feature pps is less than the threshold.

FeatureLabelCorrelationChange.add_condition_feature_pps_in_train_less_than([...])

Add condition - train dataset feature pps is less than the threshold.

FeatureLabelCorrelationChange.clean_conditions()

Remove all conditions from this check instance.

FeatureLabelCorrelationChange.conditions_decision(result)

Run conditions on given result.

FeatureLabelCorrelationChange.config()

Return check configuration (conditions' configuration not yet supported).

FeatureLabelCorrelationChange.from_config(conf)

Return check object from a CheckConfig object.

FeatureLabelCorrelationChange.metadata([...])

Return check metadata.

FeatureLabelCorrelationChange.name()

Name of class in split camel case.

FeatureLabelCorrelationChange.params([...])

Return parameters to show when printing the check.

FeatureLabelCorrelationChange.remove_condition(index)

Remove given condition by index.

FeatureLabelCorrelationChange.run(...[, ...])

Run check.

FeatureLabelCorrelationChange.run_logic(context)

Run check.

Examples#