Stay organized with collections Save and categorize content based on your preferences.
Create a machine learning model in BigQuery ML by using the Google Cloud consolePreview
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions.
Note: To provide feedback or request support for this feature, send an email to bqml-feedback@google.comThis document shows you how to use the Google Cloud console to create a BigQuery ML model.
Required rolesTo create a model and run inference, you must be granted the following roles:
roles/bigquery.dataEditor
)roles/bigquery.user
)In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify that billing is enabled for your Google Cloud project.
Enable the BigQuery and BigQuery Connection APIs.
Before you create a model, make sure that you have addressed any prerequisites for the type of model that you are creating:
If you want to use a query to select training data for a model, you must have that query available as a saved query.
Matrix factorization models require reservations. For more information, see Pricing.
The following remote models require a Cloud resource connection:
The connection's service account must also be granted certain roles, depending on the type of remote model.
To import a model, you must have that model uploaded to a Cloud Storage bucket.
Create a BigQuery dataset to contain your resources:
ConsoleIn the Google Cloud console, go to the BigQuery page.
In the Explorer pane, click your project name.
Click more_vert View actions > Create dataset.
On the Create dataset page, do the following:
For Dataset ID, type a name for the dataset.
For Location type, select a location for the dataset.
Click Create dataset.
To create a new dataset, use the bq mk
command with the --location
flag:
bq --location=LOCATION mk -d DATASET_ID
Replace the following:
LOCATION
: the dataset's location.DATASET_ID
is the ID of the dataset that you're creating.Confirm that the dataset was created:
bq ls
Use this procedure to create the following types of models:
Time series models:
Contribution analysis: Contribution analysis
Classification:
Regression:
Clustering: K-means
Recommendation: Matrix factorization
Dimensionality reduction:
These models have different sets of options according to their type. While BigQuery ML automatic tuning works well in most cases, you can choose to manually tune your model as part of the procedure. If you want to do so, refer to the documentation for the given type of model to learn more about the model options.
To create a model:
Go to the BigQuery page.
In the Explorer pane, click the dataset that you created.
Click more_vert View actions next to the dataset, and then click Create BQML Model.
The Create new model pane opens.
For Model name, type a name for the model.
If you want to create a saved query that contains the CREATE MODEL
statement for the model, select Save Query .
Click Continue.
In the Creation method section, select Train a Model in BigQuery.
In the Modeling objective section, select a modeling objective for the model.
Click Continue.
On the Model options page, select a model type. The type of model you can select varies based on the modeling objective you chose.
In the Training data section, do one of the following:
In Selected input label columns, choose the columns from the table, view, or query that you want to use as input to the model.
If there is a Required options section, specify the requested column information:
For matrix factorization models, select the following:
For times series forecasting models, select the following:
Optional: In the Optional section, specify values for additional model tuning arguments. The arguments available vary based on the type of model that you are creating.
Click Create model.
When model creation is complete, click Go to model to view model details.
Use this procedure to create the following types of remote models:
To create a model:
Go to the BigQuery page.
In the Explorer pane, click the dataset that you created.
Click more_vert View actions next to the dataset, and then click Create BQML Model.
The Create new model pane opens.
For Model name, type a name for the model.
If you want to create a saved query that contains the CREATE MODEL
statement for the model, select Save Query .
Click Continue.
In the Creation method section, select Connect to Vertex AI LLM service and Cloud AI services.
On the Model options page, select Google and Partner Models or Open Models for the model type, as appropriate for your use case.
In the Remote connection section, do the one of the following:
If you don't have have a default connection configured, or if you lack the appropriate roles, select Cloud resource connection.
For Connection, select the connection to use for the remote model, or select Create new connection to create a new connection.
Important: If you create a new connection, you must grant appropriate roles to the connection's service account before continuing. For more information about what roles to grant, see the reference documentation for the type of remote model that you are creating.In the Required options section, do one of the following:
gemini-2.0-flash
. For more information about supported models, see ENDPOINT
.https://location-aiplatform.googleapis.com/v1/projects/project/locations/location/endpoints/endpoint_id
. For more information, see ENDPOINT
.Click Create model.
When model creation is complete, click Go to model to view model details.
Use this procedure to create remote models over custom models deployed to Vertex AI.
To create a model:
Go to the BigQuery page.
In the Explorer pane, click the dataset that you created.
Click more_vert View actions next to the dataset, and then click Create BQML Model.
The Create new model pane opens.
For Model name, type a name for the model.
If you want to create a saved query that contains the CREATE MODEL
statement for the model, select Save Query .
Click Continue.
In the Creation method section, select Connect to user managed Vertex AI endpoints.
In the Remote connection section of the Model options page, do one of the following:
If you don't have have a default connection configured, or if you lack the appropriate roles, select Cloud resource connection.
For Connection, select the connection to use for the remote model, or select Create new connection to create a new connection.
Important: If you create a new connection, you must grant appropriate roles to the connection's service account before continuing. For more information about what roles to grant, see the reference documentation for the type of remote model that you are creating.In the Required options section, specify the endpoint to use. This is the shared public endpoint of a model deployed to Vertex AI, in the format https://location-aiplatform.googleapis.com/v1/projects/project/locations/location/endpoints/endpoint_id
. For more information, see ENDPOINT
.
Click Create model.
When model creation is complete, click Go to model to view model details.
Use this procedure to create remote models over Cloud AI services.
To create a model:
Go to the BigQuery page.
In the Explorer pane, click the dataset that you created.
Click more_vert View actions next to the dataset, and then click Create BQML Model.
The Create new model pane opens.
For Model name, type a name for the model.
If you want to create a saved query that contains the CREATE MODEL
statement for the model, select Save Query .
Click Continue.
In the Creation method section, select Connect to Vertex AI LLM service and Cloud AI services.
On the Model options page, select Cloud AI Services.
In the Remote connection section, do the one of the following:
If you don't have have a default connection configured, or if you lack the appropriate roles, select Cloud resource connection.
For Connection, select the connection to use for the remote model, or select Create new connection to create a new connection.
Important: If you create a new connection, you must grant appropriate roles to the connection's service account before continuing. For more information about what roles to grant, see the reference documentation for the type of remote model that you are creating.In the Required options section, select the Cloud AI service type to use.
In the Optional section, specify document processor information if you are using the CLOUD_AI_DOCUMENT_V1
service. Optionally, you can specify speech recognizer information if you are using the CLOUD_AI_SPEECH_TO_TEXT_V2
service.
Click Create model.
When model creation is complete, click Go to model to view model details.
Use this procedure to create BigQuery ML models by importing the following types of models:
To create a model:
Go to the BigQuery page.
In the Explorer pane, click the dataset that you created.
Click more_vert View actions next to the dataset, and then click Create BQML Model.
The Create new model pane opens.
For Model name, type a name for the model.
If you want to create a saved query that contains the CREATE MODEL
statement for the model, select Save Query .
Click Continue.
In the Creation method section, select Import model.
On the Model options page, select the type of model that you want to import.
For GCS path, browse for or paste in the URI for the Cloud Storage bucket that contains the model.
Click Create model.
When model creation is complete, click Go to model to view model details.
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-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4