Skip to content

Feature Set

When an app is ready, a feature set named "Default" is created automatically including all features in the processed dataset. Optionally, you can create additional feature sets as subsets of the "Default" feature set, in order to save model training time or to test how predictive certain features are on the target. Here the target feature must be included for every feature set.

This page shows how to create, modify and list feature sets within an app.

Importing the necessary modules

from aiaengine.api import featureset

Creating a feature set

Now you can add a new feature set by specifying the required parameter values as follows

create_feature_set_response = client.featuresets.CreateFeatureSet(
    featureset.CreateFeatureSetRequest(
        app_id="id_of_app_in_which_feature_set_will_be_created",
        name="Feature Set Name",
        description="What is this feature set about",
        selected_features=[
            "column_1", "column_2", "column_3", "target_column"
        ]
    )
)

Once created, the feature set is assigned with a unique id, which will be frequently used in the subsequent operations where this feature set is involved.

feature_set_id = create_feature_set_response.id

Retrieving feature set information

Then you can get information of a feature set by specifying the feature set id.

client.featuresets.GetFeatureSet(
    featureset.GetFeatureSetRequest(
        id="id_of_feature_set"
)

Updating a feature set

You can also change the name, description and selected features of a feature set with input of the feature set id.

client.featuresets.UpdateFeatureSet(
    featureset.UpdateFeatureSetRequest(
        id="id_of_feature_set_to_be_updated",
        name="Updated Feature Set Name",
        description="This feature set is updated",
        selected_features=[
            "new_column_1", "new_column_2", "new_column_3", "target_column"
        ]
    )
)

Deleting a feature set

Once a feature set is no longer needed, you can remove it by providing the feature set id.

client.featuresets.DeleteFeatureSet(
    featureset.DeleteFeatureSetRequest(
        id="id_of_feature_set_to_be_removed"
    )
)

Listing feature sets

For a given app, you can list all feature sets attached to this app by specifying the app id.

client.featuresets.ListFeatureSets(
    featureset.ListFeatureSetsRequest(
        app_id="id_of_app_in_which_feature_sets_are_listed"
    )
)