Managed ML on Google Cloud: training, serving and experiments
Choose between Agent Platform (formerly Vertex AI) training, Model Registry, endpoints and pipelines, or BigQuery ML, for a given ML task.
By Invicly Tech, , in Google Cloud Engineering and Services. About 9 minutes to read.
In short
Google Cloud offers managed machine learning on Gemini Enterprise Agent Platform (formerly Vertex AI) and inside BigQuery. The platform handles training jobs, a Model Registry, endpoints for serving, experiment tracking and pipelines. BigQuery ML lets you train simple models with SQL where your data already lives, which is often enough.
Think of it like this: BigQuery ML is a good kitchen knife that handles most meals. The full platform is the whole restaurant kitchen for when you need special equipment.
Explained simply
Machine learning means teaching a program from examples instead of writing every rule by hand. You show it past data, such as customers who left, and it learns a pattern it can apply to new customers. Google Cloud offers managed services so you do not have to set up machines and tools yourself.
The main home is Gemini Enterprise Agent Platform, which used to be called Vertex AI. It covers training a model, storing versions in a Model Registry, serving predictions from an endpoint, tracking experiments and running pipelines. Many docs and tools still use the older Vertex AI word, so expect to see both.
There are two ways to train. AutoML tries models for you from labelled data, which is fast but gives you less control. Custom training runs your own code, for example with scikit-learn or PyTorch, on machines you pick. Custom needs more skill but handles any idea.
Often you do not need all that. BigQuery ML lets you create and use a model with SQL, right where your data already sits. If a simple model such as logistic regression answers your question, BigQuery ML is cheaper and quicker to set up.
Press Play on a diagram to walk through it one step at a time.
- 1Prepare data
In BigQuery or Cloud Storage.
- 2Train
AutoML or a custom training job.
- 3Register
Save a versioned model in Model Registry.
- 4Serve
Deploy to an endpoint or run batch predictions.
- 5Monitor
Watch quality and retrain.
- 1Collect new data
- 2Retrain in a pipeline
- 3Evaluate against current model
- 4Register and deploy
- 5Monitor predictions
- Back to step 1
In depth
AutoML or custom training
AutoML suits teams with labelled data and little ML code. You choose the data and the goal, and the service searches for a good model. You get less insight into how the model works.
Custom training suits cases that need special code, a framework you already use, or large and unusual data. You package your training code in a container, or use a prebuilt one, and submit a job with the machine type you want. Costs follow the machines and time used, and GPUs are priced higher.
Start with the simplest option that can meet your accuracy target. Move to a heavier one only when you can show a need.
- AutoML: less code, less control
- Custom: any framework, more skill
- Machines and accelerators are billed by time
- Start simple and measure
Model Registry, endpoints and batch predictions
A Model Registry stores each trained model with a version number and metadata such as the metrics and the training data. Versions let you compare, promote and roll back, like releases of an app.
To serve a model in real time, deploy a version to an endpoint. The endpoint can run on one or more machines and scales between a minimum and maximum. It costs money while deployed, so undeploy test endpoints. If you score millions of rows once a day, a batch prediction job is cheaper, because nothing sits waiting between runs.
- Version every model you train
- Endpoint: real time, billed while deployed
- Batch: score a whole table or file
- Undeploy test endpoints
- Answers one request at a time
- Low latency
- Billed while deployed
- For apps and APIs
- Scores a whole dataset
- Runs as a job, then stops
- No idle machines
- For nightly scoring
Experiments and pipelines
Experiments record what you tried: parameters, data version and result metrics. Without records, a good run is hard to repeat. A pipeline chains steps such as load data, train, evaluate and register, so each run goes the same way. Pipelines are useful once you retrain on a schedule or when new data arrives.
A sensible gate is an evaluation step that stops the pipeline if the new model is worse than the current one. That prevents a bad model from reaching production by default.
- Record parameters and metrics for every run
- Pipelines make training repeatable
- Add an evaluation gate before registering
When BigQuery ML is enough
BigQuery ML supports many model types, including linear and logistic regression, tree-based models, clustering and time series, and it can call remote models too. Check the current list on the documentation page. Training uses CREATE MODEL, checking uses ML.EVALUATE, and scoring uses ML.PREDICT.
Choose it when the data is already in BigQuery, analysts know SQL, and a supported model reaches your accuracy target. Choose the full platform when you need custom code, deep learning, special hardware or low-latency online serving.
- Data in BigQuery, SQL team
- BigQuery ML
- Labelled data, little ML code
- AutoML
- Custom code or deep learning
- Custom training job
- Model Registry
- Endpoint or batch
Learn it in 5 short steps
About 35m each. Track them with a timer in your plan.
- 1Compare AutoML and custom training~35m
- 2Version models in Model Registry~35m
- 3Serve a model on an endpoint~35m
- 4Track experiments and automate pipelines~35m
- 5Know when BigQuery ML is enough~35m
Key points
- AutoML picks the model for you from labelled data. Custom training runs your own code in a container on machines you choose.
- Model Registry stores model versions so you can promote or roll back like application releases.
- An endpoint serves online predictions; batch prediction scores a large file or table without an endpoint.
- Experiments record parameters and metrics for each run, and pipelines automate the steps so they repeat the same way.
- BigQuery ML trains and predicts with SQL. If it covers your model type, you skip data movement and extra infrastructure.
Key terms
Tap a card to flip it. 0/6 known
Examples
CREATE OR REPLACE MODEL `demo.churn_model`
OPTIONS (model_type = 'LOGISTIC_REG', input_label_cols = ['churned']) AS
SELECT plan, tenure_months, tickets_last_90d, churned
FROM `demo.customers`;
SELECT * FROM ML.EVALUATE(MODEL `demo.churn_model`);Synthetic table names. ML.PREDICT then scores new rows.
Train a churn model with SQL only
You have a synthetic table demo.customers with a churned column. Create a logistic regression model, then read its metrics. You should see precision, recall and accuracy rows. This runs in BigQuery and is billed as a query, so use a small table. A BigQuery sandbox or free tier may apply; check current limits.
CREATE OR REPLACE MODEL `demo.churn_model`
OPTIONS (model_type = 'LOGISTIC_REG', input_label_cols = ['churned']) AS
SELECT plan, tenure_months, tickets_last_90d, churned
FROM `demo.customers`;
SELECT * FROM ML.EVALUATE(MODEL `demo.churn_model`);
-- Cleanup
DROP MODEL `demo.churn_model`;Decide between endpoint and batch
A shop wants a fraud score during checkout and also a nightly risk score for all customers. Checkout needs an answer in under a second, so use an endpoint. The nightly job scores a large table once, so use batch prediction. Two needs, two serving styles, one model in the registry.
checkout fraud score -> endpoint (min 1 replica, scale up)
nightly customer risk -> batch prediction job
both use model version 3 from Model Registry
cleanup: undeploy endpoint after the testQuick reference
- Agent Platform was Vertex AI; older docs use the old name
- AutoML: labelled data, less code. Custom: your own code
- Model Registry versions models for compare and rollback
- Endpoint = real time and billed while deployed; batch = job
- Undeploy test endpoints to stop charges
- BigQuery ML: CREATE MODEL, ML.EVALUATE, ML.PREDICT
- Add an evaluation gate to pipelines
Common mistakes
- Leaving an endpoint deployed after a test. Deployed machines are billed while they run.
- Reaching for custom training when a BigQuery ML model or a simple rule would do.
- Skipping versions. Without Model Registry you cannot say which model produced a bad prediction.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
For each task, say BigQuery ML or the full platform: predict sales from a BigQuery table with linear regression; train a custom PyTorch image model.
- Exercise 2medium
Write the SQL to train a model and score new rows from a table demo.new_customers.
- Exercise 3hard
Design a weekly retraining pipeline with a safety gate. List the steps and the rule that stops a worse model.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Is Vertex AI gone?
- The product is now called Gemini Enterprise Agent Platform, formerly Vertex AI. Many commands, client libraries and older pages still use the Vertex AI name.
- Do I need a GPU?
- Not for simple models. GPUs help deep learning and are billed by time, so start on small machines.
- Can I try this for free?
- BigQuery has a free tier and a sandbox with limits. Training and serving on the platform are paid, so check pricing first or practise locally with scikit-learn.