Create a feature group Stay organized with collections Save and categorize content based on your preferences.
Afeature groupis aFeature Registryresource that's associated with a BigQuery table or view containingyour feature data. A feature group can contain multiplefeatures, whereeach feature is associated with a column in the feature data source. If you wantto register your feature data source in the Feature Registry, create afeature group and thenadd features to it.
After you create a feature group and associate the BigQuery datasource, you cancreate features associatedwith the columns in the data source. Note that although it's optional toassociate a data source while creating a feature group, you must associatea BigQuery table or view before you create features within thatfeature group. Each feature corresponds to a column in the data sourceassociated with the feature group.
Why use feature groups and features?
Registering your feature data source is optional. However, you mustregister your feature data by creating feature groups and featuresin the following scenarios:
Use historical data in time series format to train a model: If the featuredata source contains latest as well as historical feature data with multiplefeature records for the same entity ID, then format this data as atime series by adding the
feature_timestampcolumn. In this scenario, youmust register the data source using feature groups and features. You can thenserve features, as follows:Useonline serving to serve thelatest feature values based on the timestamp to make real-time predictions.
Useoffline serving to servelatest as well as historical feature values to train a model.
Aggregate features from multiple sources: Use feature groups to aggregatespecific columns from multiple BigQuerydata sources when youcreate a feature view instance.
Serve null feature values: During online serving, if you want to serveonly the latest feature values, including null values, then register yourfeatured data source by creating feature groups with the
Note: To serve null feature values, you must also use an online storeinstance configured for Bigtable online serving and use scheduled data syncin your feature views.denseparameter settotrue.Use continuous data sync in your feature views: Registering your featuresis a prerequisite for using continuous data sync in your featureviews.
Note: To use continuous data sync, you must also meet the following requirements:- The online store instance must be configured forBigtable online serving.
- The associated BigQuerydata source must be located in
eu,us, orus-central1.
Monitor features for anomalies: You must register your features if you want toset upfeature monitoring toretrieve feature statistics and detect feature drift.
When not to use feature groups and features
If you want toserve embeddingsfrom your feature data source, then don't register the data source by creatingfeature groups and features. In this scenario, you must set up online serving bydirectly associating the BigQuery table or view with your featureviews.
For more information about setting up online serving without registering yourfeature data source, seeCreate a feature view from a BigQuery source.
Control access
You can control access for a feature group at the following levels:
Control access to the
FeatureGroupresource: To control access to afeature group for a specific individual, Google group, domain, or service account,set up an IAM policy for the feature group.Control access to the BigQuery data source: By default, afeature group uses the default service account configured for the project.Vertex AI Feature Store assigns theBigQuery Data ViewerIdentity and Access Management (IAM) role to this service account.This lets any user with permission to create a feature group in the projectaccess the feature data source in BigQuery. To restrict accessto the BigQuery data source or to grant access to additionalusers, you can set up your feature group to use its own dedicated service account.Vertex AI Feature Store generates a unique serviceaccount email address for each feature group configured to have a dedicatedservice account.
Note: You can view the dedicated service account email address for a featuregroup in one of the following ways:- Retrieve a list of all feature groups by using the
featureGroups.listmethod. - Retrieve the details of the feature group by using the
featureGroups.getmethod.
- Retrieve a list of all feature groups by using the
Before you begin
Before you create a feature group, complete the following prerequisites:
Ensure that there's at least one online store instance created in your project,even if you want to create a new online store instance. If you're using a newproject, thencreate an online store instancebefore you create the feature group.
Format your feature data in the BigQuery table or view to conformto theData source preparation guidelines.
Verify that your BigQuery data source contains at leastone entity ID column with
stringorintvalues.Authenticate toVertex AI, unless you've done so already.
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
Python
To use the Python samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Create a feature group to register a feature data source
Use the following samples to create a feature group and associate afeature data source, such as a BigQuery table or view.
Console
Important: You can't create a feature group with a dedicated service account from the Google Cloud console. To create a feature group with a dedicated service account, use the REST API or the Vertex AI SDK for Python.Use the following instructions to create a feature group using the Google Cloud console:
In the Vertex AI section of the Google Cloud console, go to theFeature Store page.
In theFeature groups section, clickCreate to open theBasic info pane on theCreate Feature Group page.
Specify theFeature group name.
Optional: To add labels, clickAdd label, and specify the label name and value. You can add multiple labels to a feature group.
In theBigQuery path field, clickBrowse to select BigQuery source table or view to associate with the feature group.
In theEntity ID column list, select the entity ID columnsfrom the BigQuery source table or view.
Note that this is optional if the BigQuery source table or viewhas a column named
entity_id. In that case, if you don't select an entityID column, the feature group uses theentity_idcolumn as the defaultentity ID column.ClickContinue.
In theRegister pane, click one of the following options to indicate whether you want to add features to the new feature group:
Include all columns from the BigQuery table—Create features within the feature group for all the columns in the BigQuery source table or view.
Manually enter your features—Create features based on specific columns in the BigQuery source. For each feature, enter aFeature name and click the corresponding BigQuery source column name in the list.
To add more features, clickAdd another feature.
Create an empty feature group—Create the feature group without adding features to it.
ClickCreate.
Python
To learn how to install or update the Vertex AI SDK for Python, seeInstall the Vertex AI SDK for Python. For more information, see thePython API reference documentation.
Note: This sample creates a feature group with the default service accountconfiguration.fromgoogle.cloudimportaiplatformfromvertexai.resources.previewimportfeature_storefromtypingimportListdefcreate_feature_group_sample(project:str,location:str,feature_group_id:str,bq_table_uri:str,entity_id_columns:List[str],):aiplatform.init(project=project,location=location)fg=feature_store.FeatureGroup.create(name=feature_group_id,source=feature_store.utils.FeatureGroupBigQuerySource(uri=bq_table_uri,entity_id_columns=entity_id_columns),)returnfgproject: Your project ID.location: Region where you want to create the feature group, such asus-central1.feature_group_id: The name of the new feature group that you want to create.bq_table_uri: URI of the BigQuery source table or view that you want to register for the feature group.entity_id_columns: The names of the columns containing the entity IDs. You can specify either one column or multiple columns.- To specify only one entity ID column, specify the column name in the following format:
"entity_id_column_name". - To specify multiple entity ID columns, specify the column names in the following format:
["entity_id_column_1_name", "entity_id_column_2_name", ...].
- To specify only one entity ID column, specify the column name in the following format:
REST
To create aFeatureGroupresource, send aPOST request by using thefeatureGroups.createmethod.
Before using any of the request data, make the following replacements:
- LOCATION_ID: Region where you want to create the feature group, such as
us-central1. - SERVICE_AGENT_TYPE: Optional. Service account configuration for the feature group. To use a dedicated service account for the feature group, enter
SERVICE_AGENT_TYPE_FEATURE_GROUP. - PROJECT_ID: Your project ID.
- ENTITY_ID_COLUMNS: The names of the column(s) containing the entity IDs. You can specify either one column or multiple columns.
- To specify only one entity ID column, specify the column name in the following format:
"entity_id_column_name". - To specify multiple entity ID columns, specify the column names in the following format:
["entity_id_column_1_name", "entity_id_column_2_name", ...].
- To specify only one entity ID column, specify the column name in the following format:
- FEATUREGROUP_NAME: The name of the new feature group that you want to create.
- BIGQUERY_SOURCE_URI: URI of the BigQuery source table or view that you want to register for the feature group.
- TIMESTAMP_COLUMN: Optional. Specify the name of the column containing the feature timestamps in the BigQuery source table or view.
You need to specify the timestamp column name only if the data is formatted as a time series and the column containing the feature timestamps isn't namedfeature_timestamp.
Caution: Don't include thetime_seriesparameter if you set thestatic_data_sourceparameter totrue. - STATIC_DATA_SOURCE: Optional. Enter
trueif the data isn't formatted as a time series. The default setting isfalse.
Caution: Don't includestatic_data_sourceparameter if you use thetime_seriesparameter. - DENSE: Optional. Indicate how Vertex AI Feature Store handles null values while serving data from feature views associated with the feature group:
false—This is the default setting. Vertex AI Feature Store serves only the latest non-null feature values. If the latest value for a feature is null, Vertex AI Feature Store serves the most recent non-null historical value. However, if the current as well as historical values for that feature are null, then Vertex AI Feature Store serves null as the feature value.true—For feature views with scheduled data sync, Vertex AI Feature Store serves only the latest feature values, including null values. For feature views with continuous data sync, Vertex AI Feature Store serves only the latest non-null feature values. However, if the current as well as historical values for the feature are null, then Vertex AI Feature Store serves null as the feature value. For more information about data sync types and how to configure the type of data sync in a feature view, seeSync the data in a feature view.
HTTP method and URL:
POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME
Request JSON body:
{ "service_agent_type": "SERVICE_AGENT_TYPE", "big_query": { "entity_id_columns": "ENTITY_ID_COLUMNS", "big_query_source": { "input_uri": "BIGQUERY_SOURCE_URI", } "time_series": { "timestamp_column": ""TIMESTAMP_COLUMN"", }, "static_data_source":STATIC_DATA_SOURCE, "dense":DENSE }}To send your request, choose one of these options:
curl
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME"
PowerShell
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.aiplatform.v1.UpdateFeatureGroupOperationMetadata", "genericMetadata": { "createTime": "2023-09-18T03:00:13.060636Z", "updateTime": "2023-09-18T03:00:13.060636Z" } }}What's next
Learn how tocreate a feature.
Learn how toupdate a feature group.
Learn how todelete a feature group.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.