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

add_special_types

Adds special types to features.

from_df

Construct FeatureMetadata based on the inferred feature types of an input pd.DataFrame.

get_feature_type_raw

get_feature_types_special

get_features

Returns a list of features held within the feature metadata object after being pruned through the available parameters.

get_type_group_map_raw

get_type_group_map_special_from_type_map_special

get_type_map_special

join_metadata

Join two FeatureMetadata objects together, returning a new FeatureMetadata object

join_metadatas

keep_features

Removes all features from metadata except for those in features

print_feature_metadata_full

remove_features

Removes all features from metadata that are in features

rename_features

Rename all features from metadata that are keys in rename_map to their values.

to_dict