Teradata Package for Python Function Reference on VantageCloud Lake - apply - 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 on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
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_Lake_2000
Product Category
Teradata Vantage
teradataml.store.feature_store.feature_store.FeatureStore.apply = apply(self, object)
DESCRIPTION:
    Register objects to repository.
 
PARAMETERS:
    object:
        Required Argument.
        Specifies the object to update the repository.
        Types: Feature OR DataSource OR Entity OR FeatureGroup.
 
RETURNS:
    bool.
 
RAISES:
    TeradataMLException
 
EXAMPLES:
    >>> load_example_data('dataframe', ['sales'])
    >>> df = DataFrame("sales")
 
    # Example 1: create a Feature for column 'Feb' from 'sales' DataFrame
    #            and register with repo 'vfs_v1'.
    >>> # Create Feature.
    >>> from teradataml import Feature
    >>> feature = Feature('sales:Feb', df.Feb)
    >>> # Register the above Feature with repo.
    >>> fs = FeatureStore('vfs_v1')
    >>> fs.apply(feature)
    True
    >>>
 
    # Example 2: create Entity for 'sales' DataFrame and register
    #            with repo 'vfs_v1'.
    >>> # Create Entity.
    >>> from teradataml import Entity
    >>> entity = Entity('sales:accounts', df.accounts)
    >>> # Register the above Entity with repo.
    >>> fs = FeatureStore('vfs_v1')
    >>> fs.apply(entity)
    True
    >>>
 
    # Example 3: create DataSource for 'sales' DataFrame and register
    #            with repo 'vfs_v1'.
    >>> # Create DataSource.
    >>> from teradataml import DataSource
    >>> ds = DataSource('Sales_Data', df)
    >>> # Register the above DataSource with repo.
    >>> fs = FeatureStore('vfs_v1')
    >>> fs.apply(ds)
    True
    >>>
 
    # Example 4: create FeatureStore with all the objects
    #            created in above examples and register with
    #            repo 'vfs_v1'.
    >>> # Create FeatureGroup.
    >>> from teradataml import FeatureGroup
    >>> fg = FeatureGroup('Sales',
    ...                   features=feature,
    ...                   entity=entity,
    ...                   data_source=data_source)
    >>> # Register the above FeatureStore with repo.
    >>> fs = FeatureStore('vfs_v1')
    >>> fs.apply(fg)
    True
    >>>