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)]