FeatureSpec#
- class scikitplot.feature_selection.FeatureSpec(name, position, role, family, kind, kind_origin, stats, assessments=(), tags=(), binning=None, aliases=())[source]#
Everything a fitted schema knows about one column.
- Parameters:
- namestr
Current column name.
- positionint
Column position in the training frame.
- rolestr
FeatureRolevalue.- familystr
DtypeFamilyvalue.- kindstr
FeatureKindvalue.- kind_origin{“inferred”, “declared”}
Where the kind came from.
- statsFeatureStats
Training statistics.
- assessmentstuple of Assessment
Sorted by name.
- tagstuple of str, default=()
User tags.
- binningBinningRecommendation or None, default=None
Bin recommendation, when binning is enabled.
- aliasestuple of str, default=()
Earlier names, oldest first (see
FeatureSchema.rename).
- Parameters:
name (str)
position (int)
role (str)
family (str)
kind (str)
kind_origin (str)
stats (FeatureStats)
assessments (tuple[Assessment, ...])
binning (BinningRecommendation | None)
See also
FeatureSchemaThe collection of specs.
- assess(name)[source]#
Return the recorded answer to assessment
name.- Parameters:
- namestr
Assessment name (
"skewed","discrete"…).
- Returns:
- Assessment
State, reasons, evidence and provenance.
- Raises:
- KeyError
If the schema’s policy did not run that assessment; the message lists the available names.
- Parameters:
name (str)
- Return type:
- assessments: tuple[Assessment, ...] = ()#
- binning: BinningRecommendation | None = None#
- explain()[source]#
Return a short, human-readable description of the feature.
- Returns:
- str
Several lines: role, kind, key statistics, true assessments, and the binning recommendation.
- Return type:
- classmethod from_dict(data)[source]#
Rebuild a spec from
to_dictoutput, checking every field.- Parameters:
- datamapping
Stored form.
- Returns:
- FeatureSpec
The spec.
- Raises:
- ValueError
For an off-contract record.
- Parameters:
- Return type:
- stats: FeatureStats[source]#