PropertyLabelCorrelation#

class PropertyLabelCorrelation[source]#

Return the PPS (Predictive Power Score) of all properties in relation to 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 to predict the label by a text property (e.g. text length, language etc.). A high PPS (close to 1) can mean that there’s a bias in the dataset, as a single property can predict the label successfully, using simple classic ML algorithms - meaning that a deep learning algorithm may accidentally learn these properties instead of more accurate complex abstractions.

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

Parameters
properties_to_ignore: Optional[List[str]], default: None

List of properties to ignore in the check.

properties_to_include: Optional[List[str]], default: None

List of properties to include in the check. If None, all properties will be included.

ppscore_paramsdict , default: None

dictionary of additional parameters for the ppscore.predictors function

n_top_propertiesint , default: 5

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

n_samplesint , default: 100_000

number of samples to use for this check.

random_stateint , default: None

Random state for the ppscore.predictors function

__init__(properties_to_ignore: Optional[List[str]] = None, properties_to_include: Optional[List[str]] = None, ppscore_params: Optional[Dict[Any, Any]] = None, n_top_properties: int = 5, n_samples: int = 100000, **kwargs)[source]#
__new__(*args, **kwargs)#

Methods

PropertyLabelCorrelation.add_condition(name, ...)

Add new condition function to the check.

PropertyLabelCorrelation.add_condition_property_pps_less_than([...])

Add condition that will check that pps of the specified properties is less than the threshold.

PropertyLabelCorrelation.clean_conditions()

Remove all conditions from this check instance.

PropertyLabelCorrelation.conditions_decision(result)

Run conditions on given result.

PropertyLabelCorrelation.config([...])

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

PropertyLabelCorrelation.from_config(conf[, ...])

Return check object from a CheckConfig object.

PropertyLabelCorrelation.from_json(conf[, ...])

Deserialize check instance from JSON string.

PropertyLabelCorrelation.metadata([...])

Return check metadata.

PropertyLabelCorrelation.name()

Name of class in split camel case.

PropertyLabelCorrelation.params([show_defaults])

Return parameters to show when printing the check.

PropertyLabelCorrelation.remove_condition(index)

Remove given condition by index.

PropertyLabelCorrelation.run(dataset[, ...])

Run check.

PropertyLabelCorrelation.run_logic(context, ...)

Run check.

PropertyLabelCorrelation.to_json([indent, ...])

Serialize check instance to JSON string.

Examples#