FeatureMixin#
- class pybear.base.FeatureMixin#
Bases:
objectThis mixin manages feature names for pybear transformers and estimators.
It is able to collect feature names from data containers, validate them, and provides access points for users. This mixin provides the get_feature_names_out method of the pybear API to pybear transformers.
The get_feature_names_out method returns the features names that correspond to the output of transform. This particular method can only be used for transformers that do not alter the feature axis, that is, the feature name output is one-to-one with the feature name input. If the transformer does alter the feature axis of the data, then a dedicated get_feature_names_out method will need to be used in place of this one.
If you are trying to use this to build your own estimator or transformer, it is probably better to explore this mixin in the source code, because of hidden methods and documentation not exposed in the online docs.
Methods
get_feature_names_out([input_features])Return the feature name vector for the transformed output.
- get_feature_names_out(input_features=None)#
Return the feature name vector for the transformed output.
If input_features is None, then
feature_names_in_is used as feature names in. If feature_names_in_ is not defined, then the following input feature names are generated: ‘[“x0”, “x1”, …, “x(n_features_in_- 1)”]’.If input_features is an array-like, then input_features must match feature_names_in_ if feature_names_in_ is defined.
- Parameters:
- input_featuresSequence[str] | None
Input features.
- Returns:
- feature_names_outnumpy.ndarray[object]
The feature names for the transformed output.