Feature Object | Teradata Package for Python - Feature Object - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

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>