autogluon.common.features.feature_metadata.FeatureMetadata#
- class autogluon.common.features.feature_metadata.FeatureMetadata(type_map_raw: Dict[str, str], type_group_map_special: Optional[Dict[str, List[str]]] = None, type_map_special: Optional[Dict[str, List[str]]] = None)[source]#
Feature metadata contains information about features that are not directly apparent in the raw data itself. This enables feature generators to properly process features, and allows downstream models to properly handle features during training and inference.
- Parameters
type_map_raw (Dict[str, str]) –
Dictionary of feature names to raw types. The values can be anything, but it is generally recommended they be one of:
[‘int’, ‘float’, ‘object’, ‘category’, ‘datetime’]
type_group_map_special (Dict[str, List[str]], optional) –
Dictionary of special types to lists of feature names. The keys can be anything, but it is generally recommended they be one of:
[‘binned’, ‘datetime_as_int’, ‘datetime_as_object’, ‘text’, ‘text_as_category’, ‘text_special’, ‘text_ngram’, ‘image_path’, ‘stack’]
For descriptions of each special feature-type, see: autogluon.common.features.types Feature names that appear in the value lists must also be keys in type_map_raw. Feature names are not required to have special types. Only one of type_group_map_special and type_map_special can be specified.
type_map_special (Dict[str, List[str]], optional) – Dictionary of feature names to lists of special types. This is an alternative representation of the special types. Only one of type_group_map_special and type_map_special can be specified.
- __init__(type_map_raw: Dict[str, str], type_group_map_special: Optional[Dict[str, List[str]]] = None, type_map_special: Optional[Dict[str, List[str]]] = None)[source]#
Methods
Adds special types to features.
Construct FeatureMetadata based on the inferred feature types of an input
pd.DataFrame
.Returns a list of features held within the feature metadata object after being pruned through the available parameters.
Join two FeatureMetadata objects together, returning a new FeatureMetadata object
Removes all features from metadata except for those in features
Removes all features from metadata that are in features
Rename all features from metadata that are keys in rename_map to their values.