FeatureMapping#

class scikitplot.feature_selection.FeatureMapping(parents, relation, quality='exact', output_qualities=())[source]#

How one transformer’s outputs derive from its inputs.

Return it from get_feature_lineage(input_features) on your own transformer to make it exactly traceable.

Parameters:
parentstuple of tuple of int

For every output, the positions of the inputs it is computed from.

relationstr

A Relation value.

qualitystr, default=”exact”

A LineageQuality value.

output_qualitiestuple of str, default=()

Per-output qualities when they differ (an imputer whose filled values use other columns, mixed, beside exact missing indicators); empty means every output has quality.

Parameters:

Examples

>>> from scikitplot.feature_selection import FeatureMapping
>>> FeatureMapping(parents=((0,), (0,), (1,)), relation="expand").n_outputs
3
classmethod all_to_all(n_in, n_out, quality)[source]#

Return a mapping where every output depends on every input.

Parameters:
Return type:

FeatureMapping

classmethod identity(n)[source]#

Return the one-to-one mapping of n features.

Parameters:

n (int)

Return type:

FeatureMapping

property n_outputs: int#

Number of outputs.

Type:

int

output_qualities: tuple[str, ...] = ()#
parents: tuple[tuple[int, ...], ...][source]#
quality: str = 'exact'#
quality_of(output)[source]#

Return the lineage quality of output output.

Parameters:

output (int)

Return type:

str

relation: str[source]#
classmethod subset(indices)[source]#

Return a mapping that keeps the inputs at indices, in that order.

Parameters:

indices (Iterable[int])

Return type:

FeatureMapping