Feature Class | Teradata Package for Python - Feature Class - Teradata Package for Python

Teradata® Package for Python User Guide

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

The Feature class represents a single feature with its metadata and properties.

Syntax

Feature(name, column, feature_type=FeatureType.CONTINUOUS, description=None, tags=None, status=FeatureStatus.ACTIVE)

Required Parameters

name
Specifies unique name of the Feature.
column
Specifies the DataFrame Column.

Optional Parameters

feature_type
Specifies whether a feature is continuous or discrete.

Default value: FeatureType.CONTINUOUS

description
Specifies the human readable description of the Feature.
tags
Specifies the tags for the Feature.
status
Specifies whether the feature is archived or active.

Example setup

>>> from teradataml import DataFrame, Feature, FeatureType, load_example_data, FeatureStatus

Load the sales data to the database.

>>> load_example_data("dataframe", "sales")

Create DataFrame on sales data.

>>> df = DataFrame("sales")
>>> 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

Example 1: Create a Categorical Feature for column 'Feb' for 'sales' DataFrame

This example creates a Categorical Feature for column 'Feb' for 'sales' DataFrame and names it 'sales_Feb'.

>>> from teradataml import Feature
>>> feature = Feature('sales_Feb', column=df.Feb,
...                   feature_type=FeatureType.CATEGORICAL, status=FeatureStatus.ACTIVE)
>>> feature
Feature(name=sales_Feb)

Example 2: Create a Continuous Feature for column 'Jan' for 'sales' DataFrame

This example creates a Continuous Feature for column 'Jan' for 'sales' DataFrame and names it 'sales_Jan'.

>>> feature = Feature('sales_Jan', column='Jan',
...                   feature_type=FeatureType.CONTINUOUS, status=FeatureStatus.ACTIVE)
>>> feature
Feature(name=sales_Jan)