Feature serving
This document describes your options for making
features available for BigQuery ML
model training and inference. For all options, you must save the features in
BigQuery tables as a prerequisite first step.
Point-in-time correctness
The data used to train a model often has time dependencies built into it. When
you create a feature table for time sensitive features, include a timestamp
column to represent the feature values as they existed at a given time for each
row. You can then use point-in-time lookup functions when querying data from
these feature tables in order to ensure that there is no data
leakage between
training and serving. This process enables point-in-time correctness.
Use the following functions to specify point-in-time cutoffs when retrieving
time sensitive features:
Serve features in BigQuery ML
To train models and perform batch inference in BigQuery ML, you
can retrieve features using one of the point-in-time lookup functions described
in the Point-in-time correctness section. You can
include these functions in the
query_statement
clause of the CREATE MODEL
statement for
training, or in the query_statement
clause of the appropriate table-valued
function, such as
ML.PREDICT
,
for serving.
Serve features with Vertex AI Feature Store
To serve features to BigQuery ML models that are
registered in Vertex AI,
you can use
Vertex AI Feature Store.
Vertex AI Feature Store works on top of feature tables in
BigQuery to manage and serve features with low latency. You can
use online serving
to retrieve features in real time for online prediction, and you can use
offline serving
to retrieve features for model training.
For more information about preparing BigQuery feature data
to be used in Vertex AI Feature Store, see
Prepare data source.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eFeatures must be saved in BigQuery tables before they can be used for BigQuery ML model training and inference.\u003c/p\u003e\n"],["\u003cp\u003eIncluding a timestamp column in feature tables allows for point-in-time correctness, preventing data leakage between training and serving.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eML.FEATURES_AT_TIME\u003c/code\u003e and \u003ccode\u003eML.ENTITY_FEATURES_AT_TIME\u003c/code\u003e functions are used to specify point-in-time cutoffs when retrieving time-sensitive features.\u003c/p\u003e\n"],["\u003cp\u003eBigQuery ML models can use point-in-time lookup functions in \u003ccode\u003eCREATE MODEL\u003c/code\u003e statements or in table-valued functions like \u003ccode\u003eML.PREDICT\u003c/code\u003e to retrieve features for training and batch inference.\u003c/p\u003e\n"],["\u003cp\u003eVertex AI Feature Store can be used to manage and serve features with low latency for BigQuery ML models registered in Vertex AI, supporting both real-time online prediction and offline model training.\u003c/p\u003e\n"]]],[],null,[]]