Feature stores all the details of the Feature. The following example explains creating a categorical feature named 'sales_Feb' for column 'Feb' from 'sales' DataFrame.
>>> from teradataml import DataFrame >>> df = DataFrame("sales") >>> df >>> df
Feb Jan Mar Apr datetime accounts Orange Inc 210.0 NaN NaN 250.0 04/01/2017 Jones LLC 200.0 150.0 140.0 180.0 04/01/2017 Blue Inc 90.0 50.0 95.0 101.0 04/01/2017 Alpha Co 210.0 200.0 215.0 250.0 04/01/2017 Yellow Inc 90.0 NaN NaN NaN 04/01/2017
>>> from teradataml import Feature, FeatureType
>>> feature = Feature('sales_Feb', column=df.Feb, feature_type=FeatureType.CONTINUOUS, description='Feature for February sales.', tags=['sales', 'Monthly sales'])
>>> feature Feature(name=sales_Feb) >>>
Properties
- name
- Specifies unique name of the Feature in Feature Store.
Example:
>>> feature.name 'sales_Feb' >>>
- column_name
- Specifies name of the column the Feature belongs to.
Example:
>>> feature.column_name 'Feb' >>>
- description
- Specifies the description for the Feature.
Example:
>>> feature.description 'Feature for February sales.' >>>
- tags
- Specifies the tags for the Feature.
Example:
>>> feature.tags ['sales', 'Monthly sales']
- data_type
- Specifies the data type for the Feature.
Example:
>>> feature.data_type FLOAT()
- feature_type
- Specifies whether a Feature is continuous or categorical.
Continuous example:
>>> feature.feature_type <FeatureType.CONTINUOUS: 1>
- status
- Specifies the status of the Feature (Active or Inactive).
- Active: It will participate during model generation.
- Inactive: It won't participate even though it is available in FeatureStore.
Example:
>>> feature.status <FeatureStatus.ACTIVE: 1>