Reference patterns
This page provides links to business use cases, sample code, and technical
reference guides for BigQuery ML use cases. Use these resources to
identify best practices and speed up your application development.
Logistic regression
This pattern shows how to use logistic regression to perform propensity
modeling for gaming applications.
Learn how to use BigQuery ML to train, evaluate, and get
predictions from several different types of propensity models.
Propensity models can help you to determine the likelihood of specific
users returning to your app, so you can use that information in
marketing decisions.
Time-series forecasting
These patterns show how to create time-series forecasting solutions.
Build a demand forecasting model
Learn how to build a time series model that you can use to forecast retail
demand for multiple products.
Forecast from Google Sheets using BigQuery ML
Learn how to operationalize machine learning with your business
processes by combining
Connected Sheets with a forecasting
model in BigQuery ML. This pattern walks you through
the process for building a forecasting model for website traffic using
Google Analytics data. You can extend this pattern to work
with other data types and other machine learning models.
Anomaly detection
This pattern shows how to use anomaly detection to find real-time credit
card fraud.
Learn how to use transactions and customer data to train machine
learning models in BigQuery ML that can be used in a
real-time data pipeline to identify, analyze, and trigger alerts for
potential credit card fraud.
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\u003eThis page provides resources such as business use cases, sample code, and technical guides for various BigQuery ML applications.\u003c/p\u003e\n"],["\u003cp\u003eLearn to create propensity models with logistic regression, which can determine the likelihood of user engagement, such as returning to your app.\u003c/p\u003e\n"],["\u003cp\u003eExplore time-series forecasting patterns to build models for predicting retail demand for products.\u003c/p\u003e\n"],["\u003cp\u003eDiscover how to combine Connected Sheets with a forecasting model in BigQuery ML to operationalize machine learning for business tasks, like forecasting website traffic.\u003c/p\u003e\n"],["\u003cp\u003eUtilize anomaly detection patterns to identify and analyze potential credit card fraud in real-time using machine learning models trained in BigQuery ML.\u003c/p\u003e\n"]]],[],null,["# Reference patterns\n==================\n\nThis page provides links to business use cases, sample code, and technical\nreference guides for BigQuery ML use cases. Use these resources to\nidentify best practices and speed up your application development.\n\nLogistic regression\n-------------------\n\nThis pattern shows how to use logistic regression to perform propensity\nmodeling for gaming applications.\n\nLearn how to use BigQuery ML to train, evaluate, and get\npredictions from several different types of propensity models.\nPropensity models can help you to determine the likelihood of specific\nusers returning to your app, so you can use that information in\nmarketing decisions.\n\n- Blog post: [Churn prediction for game developers using Google Analytics 4 and BigQuery ML](/blog/topics/developers-practitioners/churn-prediction-game-developers-using-google-analytics-4-ga4-and-bigquery-ml)\n- Notebook: [Churn prediction solution notebook](https://github.com/GoogleCloudPlatform/analytics-componentized-patterns/tree/master/gaming/propensity-model/bqml)\n\nTime-series forecasting\n-----------------------\n\nThese patterns show how to create time-series forecasting solutions.\n\n### Build a demand forecasting model\n\nLearn how to build a time series model that you can use to forecast retail\ndemand for multiple products.\n\n- Blog post: [How to build demand forecasting models with BigQuery ML](/blog/topics/developers-practitioners/how-build-demand-forecasting-models-bigquery-ml)\n- Notebook: [Demand forecasting solution notebook](https://github.com/GoogleCloudPlatform/analytics-componentized-patterns/blob/master/retail/time-series/bqml-demand-forecasting/bqml_retail_demand_forecasting.ipynb)\n\n### Forecast from Google Sheets using BigQuery ML\n\nLearn how to operationalize machine learning with your business\nprocesses by combining\n[Connected Sheets](/bigquery/docs/connected-sheets) with a forecasting\nmodel in BigQuery ML. This pattern walks you through\nthe process for building a forecasting model for website traffic using\nGoogle Analytics data. You can extend this pattern to work\nwith other data types and other machine learning models.\n\n- Blog post: [How to use a machine learning model from Google Sheets using BigQuery ML](/blog/topics/developers-practitioners/how-use-machine-learning-model-google-sheet-using-bigquery-ml)\n- Sample code: [BigQuery ML forecasting with Sheets](https://github.com/googleworkspace/ml-integration-samples/tree/master/apps-script/BQMLForecasting)\n- Template: [BigQuery ML forecasting with Sheets](https://docs.google.com/spreadsheets/d/1njedwGjBOkUbTS_HYD0wIPuQIDHgobp1D80qO-OsNH0/copy)\n\nAnomaly detection\n-----------------\n\nThis pattern shows how to use anomaly detection to find real-time credit\ncard fraud.\n\nLearn how to use transactions and customer data to train machine\nlearning models in BigQuery ML that can be used in a\nreal-time data pipeline to identify, analyze, and trigger alerts for\npotential credit card fraud.\n\n- Sample code: [Real-time credit card fraud detection](https://github.com/googlecloudplatform/fraudfinder)\n- Overview video: [Fraudfinder: A comprehensive solution for real data science problems](https://io.google/2022/program/9a759b60-9a9b-4744-bd22-6e21a4a864cd/)"]]