Use the update() method to switch to a different filter scenario in the filter manager.
Required Parameter
- filter_id
- Specifies the filter ID to switch to.The 'filter_id' must exist in the filter artifact's table.
Example: Create a FilterManager, Load Filter Definitions, and Switch to a Different Scenario
>>> from teradataml import load_example_data, DataFrame, FeatureStore, FilterManager
>>> load_example_data('dataframe', 'admissions_train')
>>> df = DataFrame("admissions_train")
Create a FeatureStore.
>>> 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()
>>> fm = FilterManager(repo='vfs_v1', name='stats_filter_manager')
Filter Manager 'stats_filter_manager' does not exist. Run FilterManager.load_filter() to create it.
>>> fm.load_filter(df=df.groupby('stats').count()[['stats']])
True
>>> fm.get_current_filter()
stats 0 Advanced
Switch to filter scenario with filter_id = 2.
>>> fm.update(2) >>> fm.get_current_filter()
stats 0 Beginner