Teradata Package for Python Function Reference | 20.00 - list_features - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference - 20.00
- Deployment
- VantageCloud
- VantageCore
- Edition
- Enterprise
- IntelliFlex
- VMware
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.03
- Published
- December 2024
- ft:locale
- en-US
- ft:lastEdition
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Enterprise_2000
- lifecycle
- latest
- Product Category
- Teradata Vantage
- teradataml.store.feature_store.feature_store.FeatureStore.list_features = list_features(self, archived=False) -> teradataml.dataframe.dataframe.DataFrame
- DESCRIPTION:
List all the features.
PARAMETERS:
archived:
Optional Argument.
Specifies whether to list effective features or archived features.
When set to False, effective features in FeatureStore are listed,
otherwise, archived features are listed.
Default Value: False
Types: bool
RETURNS:
teradataml DataFrame
RAISES:
None
EXAMPLES:
>>> from teradataml import DataFrame, FeatureStore, load_example_data
>>> load_example_data('dataframe', 'sales')
# Create FeatureStore for repo 'vfs_v1'.
>>> fs = FeatureStore("vfs_v1")
# Create teradataml DataFrame.
>>> df = DataFrame("sales")
# Create a FeatureGroup from teradataml DataFrame.
>>> fg = FeatureGroup.from_DataFrame(name='sales',
... entity_columns='accounts',
... df=df,
... timestamp_col_name='datetime')
# Apply the FeatureGroup to FeatureStore.
>>> fs.apply(fg)
True
# Example 1: List all the effective Features in the repo 'vfs_v1'.
>>> fs.list_features()
column_name description creation_time modified_time tags data_type feature_type status group_name
name
Mar Mar None 2024-09-30 11:21:43.314118 None None BIGINT CONTINUOUS ACTIVE sales
Jan Jan None 2024-09-30 11:21:42.655343 None None BIGINT CONTINUOUS ACTIVE sales
Apr Apr None 2024-09-30 11:21:44.143402 None None BIGINT CONTINUOUS ACTIVE sales
Feb Feb None 2024-09-30 11:21:41.542627 None None FLOAT CONTINUOUS ACTIVE sales
>>>
# Example 2: List all the archived Features in the repo 'vfs_v1'.
# Note: Feature can only be archived when it is not associated with any Group.
# Let's remove Feature 'Feb' from FeatureGroup.
>>> fg.remove(fs.get_feature('Feb'))
True
# Apply the modified FeatureGroup to FeatureStore.
>>> fs.apply(fg)
True
# Archive Feature 'Feb'.
>>> fs.archive_feature('Feb')
Feature 'Feb' is archived.
True
# List all the archived Features in the repo 'vfs_v1'.
>>> fs.list_features(archived=True)
name column_name description creation_time modified_time tags data_type feature_type status archived_time group_name
0 Feb Feb None 2024-09-30 11:21:41.542627 None None FLOAT CONTINUOUS ACTIVE 2024-09-30 11:30:49.160000 sales
>>>