Use the FilterManager class to manage partitioned data processing within a FeatureStore repository. It creates and manages filter artifacts that allow sequential processing of large datasets.
Syntax
FilterManager(repo, name)
Required Parameters
- repo
- Specifies the name of the database where the filter manager resides.
- object
- Specifies the name of the filter manager to be created.
Example Setup
>>> from teradataml import DataFrame, load_example_data, FeatureStore, FilterManager
>>> load_example_data('dataframe', 'admissions_train')
>>> df = DataFrame("admissions_train")
Create a feature store.
>>> fs = FeatureStore(repo='vfs_v1', data_domain='sales')
Repo vfs_v1 does not exist. Run FeatureStore.setup() to create the repo and setup FeatureStore.
>>> fs.setup()
True
Example 1: Create a FilterManager To Manage Filters Related to Statistics Features in the Repository 'vfs_v1' with Name 'stats_filter_manager'
Create an instance of FilterManager.
>>> fm = FilterManager(repo='vfs_v1', name='stats_filter_manager') >>> fm
Filter Manager 'stats_filter_manager' does not exist. Run FilterManager.load_filter() to create it. FilterManager(repo=vfs_v1, name=stats_filter_manager, filters=None)
Load filter definitions into the filter manager using a DataFrame.
>>> fm.load_filter(df=df.groupby('stats').count()[['stats']])
True
>>> fm
FilterManager(repo=vfs_v1, name=stats_filter_manager, filters=3)