# Vertex AI and BigQuery ML — Google Cloud Platform

Source: https://www.skillbyai.com/en/gcp/b-ai

> Know where machine learning and generative AI fit on Google Cloud.

## ML platforms close to the data

**Vertex AI** is Google Cloud's machine-learning platform: training and tuning custom models, managed **endpoints** for online prediction, batch prediction, pipelines, a feature store and model monitoring. Its **Model Garden** and generative AI APIs give access to Google's **Gemini** models and many open and third-party models, with features such as grounding and evaluation, all governed by the same IAM, VPC controls and data-location settings as the rest of your project. **BigQuery ML** lets analysts create and use models with SQL (`CREATE MODEL`, `ML.PREDICT`) directly where the data lives, including calling remote models hosted on Vertex AI. For a student or a small team, the practical lesson is to start with managed APIs and BigQuery ML before building custom training infrastructure.

## A model in BigQuery ML

Train a logistic regression to predict churn, then score current customers, all in SQL.

```sql
CREATE OR REPLACE MODEL shop.churn_model
OPTIONS (model_type = 'logistic_reg', input_label_cols = ['churned']) AS
SELECT days_since_last_order, orders_last_90d, avg_basket, support_tickets, churned
FROM shop.customer_features
WHERE snapshot_date = '2026-06-30';

SELECT customer_id, predicted_churned_probs
FROM ML.PREDICT(
  MODEL shop.churn_model,
  (SELECT * FROM shop.customer_features WHERE snapshot_date = CURRENT_DATE()));
```

## Evaluate before you trust a model

Run `ML.EVALUATE` and compare against a simple baseline (for example "customers with no order in 60 days churn"). A model that cannot beat a one-line rule is not ready for production.

**Quiz:** An analyst wants to train a simple model without moving data out of the warehouse. What should they use?

- [x] BigQuery ML
- [ ] Cloud Tasks
- [ ] Memorystore
- [ ] Cloud NAT

*Answer:* BigQuery ML. BigQuery ML trains and runs models with SQL inside BigQuery.
