remove_feature() | FeatureGroup Method | Teradata Package for Python - remove_feature() - 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

Use the remove_feature() method to remove objects from the feature group.

Optionally, use this method to detach a feature from a feature group.

Required Parameter

object
Specifies the object to be removed from the feature group.

Example setup

>>> load_example_data('dataframe', ['sales'])
>>> df = DataFrame("sales")

Create the features.

>>> jan_feature = Feature("sales:Jan", df.Jan)
>>> feb_feature = Feature("sales:Fan", df.Feb)
>>> mar_feature = Feature("sales:Mar", df.Mar)
>>> apr_feature = Feature("sales:Jan", df.Apr)

Create an entity.

>>> entity = Entity("sales:accounts", df.accounts)

Create a data source.

>>> data_source = DataSource("sales_source", df.show_query())

Create the feature group.

>>> fg = FeatureGroup('Sales',
...                   		features=[jan_feature, feb_feature, mar_feature, apr_feature],
...                   		entity=entity,
...                  	 	data_source=data_source)

Example 1: Remove the Feature with name "sales:Feb" from FeatureGroup

>>> fg.remove_feature(feb_feature)
True

Get the features from the feature group.

>>> fg.features
[Feature(name=sales:Jan), 
 Feature(name=sales:Mar), 
 Feature(name=sales:Apr)]