Predict Order Returns with BigQuery ML

Use BigQuery ML to train, evaluate, and score a return-risk model that predicts which retail orders are more likely to be returned.
GCP • AI/ML • Advanced • Retail

Architecture Diagram

Build this project

Included in Data0to1 Project Library

What this project solves

Retail businesses lose time and money when orders are returned.

Some returns are normal, but if teams can identify risky orders earlier, they can plan better follow-ups, improve customer experience, and reduce operational surprises.

In this pipeline, you will use BigQuery ML to create a return-risk prediction workflow. You will prepare model-ready features from retail order, customer, item, and return data, train and evaluate a model, score recent orders, store prediction results in BigQuery, and orchestrate the workflow using Cloud Composer.

What you’ll build

  • Build a model-ready feature table from retail data
  • Create labels from matured return history
  • Train a return-risk model using BigQuery ML
  • Evaluate model performance
  • Score recent orders for return risk
  • Store prediction results in BigQuery
  • Track model runs, metrics, and prediction status
  • Orchestrate the ML workflow using Cloud Composer

How you’ll build it

  • Prepare features from order, customer, item, and return data
  • Create a labeled training dataset for return prediction
  • Train and evaluate a BigQuery ML model
  • Score recent orders and write predictions back to BigQuery
  • Orchestrate the ML workflow using Cloud Composer

Tools you’ll use

BigQuery • BigQuery ML • Cloud Composer • Apache Airflow

What you’ll walk away with

After completing this pipeline, you will be able to:

  1. Explain how BigQuery ML fits into a data pipeline
  2. Prepare feature and label tables for ML training
  3. Train and evaluate a return-risk model using BigQuery ML
  4. Score new retail orders and store prediction results
  5. Orchestrate and track an ML workflow on GCP

Ready to build this project?

Get access to the project code, setup files, architecture walkthrough, implementation videos, and support.