Google Cloud Intensive
DAY 04 ยท M4 ยท AI DEVELOPMENT WORKFLOW
M4Welcome
โญ 0 pts
DAY 04 ยท MODULE 4 ยท THE FINALE

From data to deployed. ๐Ÿ”„

The last module. Build a model end-to-end โ€” data โ†’ development โ†’ serving โ€” plus MLOps, and a peek at how a neural network actually learns.

Module 4 โ€” 6 Chapters ๐Ÿ—บ๏ธ

The official AI Development Workflow course. The whole journey, from raw data to a model in production.

๐Ÿฝ๏ธ

1 ยท The ML Workflow

3 stages overview

๐Ÿฅ•

2 ยท Data Preparation

Upload + features

๐Ÿ‘จโ€๐Ÿณ

3 ยท Model Development

Train + evaluate

๐Ÿš€

4 ยท Model Serving

Deploy + monitor

๐Ÿ”„

5 ยท MLOps

Automate the workflow

๐Ÿง 

6 ยท How ML Learns

Inside a neural net

One analogy ties it together โ€” building an ML model is like running a restaurant. You'll see. Jom.
Chapter 1 ยท The ML Workflow

Building ML = Running a Restaurant ๐Ÿฝ๏ธ

Three stages. You start with raw ingredients and finish by serving the dish.

STAGE 1

๐Ÿฅ• Data Preparation

Prep the raw ingredients

โ†’
STAGE 2

๐Ÿ‘จโ€๐Ÿณ Model Development

Experiment with recipes

โ†’
STAGE 3

๐Ÿฝ๏ธ Model Serving

Serve the meal

Why serving mattersA model that never reaches production is just a theoretical model โ€” no use. You have to serve the meal.

It's a Loop, Not a Line ๐Ÿ”

The workflow is iterative. You go back and forth โ€” e.g. while training you might return to the data for better features; while monitoring you might catch drift and adjust.

๐Ÿ–ฑ๏ธ AutoML

no-code path
  • Build the whole workflow through the UI
  • Little ML expertise, no coding

โŒจ๏ธ Code path

Vertex AI Pipelines
  • Workbench / Colab + pre-built SDKs
  • Automate the workflow programmatically
Good news โ€” the iterative steps can be automated with MLOps. More on that in Chapter 5.
Chapter 2 ยท Data Preparation

Stage 1 โ€” Prep the Ingredients ๐Ÿฅ•

Two steps: upload the data, then engineer the features. Data can come from Cloud Storage, BigQuery, or your local machine.

AutoML tabular objectives

๐Ÿ“ˆ

Regression

Predict a number

๐Ÿท๏ธ

Classification

Predict a category

๐Ÿ“…

Forecasting

Predict over time

Quality & quantity matter: a model needs a lot of data, and how good & how much you have decides how well it learns.

Feature Engineering ๐Ÿ”ช

Before cooking, you peel the carrots and chop the onions. Same with data โ€” you process it before the model trains.

What's a feature?A factor that contributes to the prediction โ€” like an independent variable in statistics, or a column in a table.
Preparing features is challenging & tedious โ€” so Vertex AI gives you a Feature Store to make it easier. Next slide.

Vertex AI Feature Store ๐Ÿ—„๏ธ

A central repository to manage, serve & share features โ€” for real-time (online) and batch (offline) serving. Even ready for Gen AI embeddings.

๐Ÿค

Shareable

One central source โ€” consistency across the org.

โ™ป๏ธ

Reusable

Save time, no duplicated effort.

๐Ÿ“ˆ

Scalable

Auto-scales for low-latency serving.

๐Ÿ–ฑ๏ธ

Easy to use

Friendly UI.

Remember the four: shareable, reusable, scalable, easy.
Chapter 3 ยท Model Development

Stage 2 โ€” Cook & Taste ๐Ÿ‘จโ€๐Ÿณ

Two steps that loop: train the model (cook the recipe), then evaluate it (taste the meal). Repeat.

To set up training you specifyโ€ฆ

๐Ÿ“‚

Method

Your dataset ยท AutoML or custom

๐ŸŽฏ

Objective

The task โ€” e.g. classification

โš™๏ธ

Details

Target column, features, budget

AutoML then trains and picks the best model from thousands โ€” thanks to neural architecture search & transfer learning (from Module 3).

Evaluate โ€” The Confusion Matrix ๐Ÿ”ข

Did the model "predict cat" correctly? Four outcomes. (โœ“ = the model was right.)

Actually Cat
Actually Not
Predicted
Cat
โœ… True Positivesaid cat ยท is cat
โŒ False Positivesaid cat ยท isn't ยท Type I
Predicted
Not
โŒ False Negativesaid not ยท is ยท Type II
โœ… True Negativesaid not ยท isn't
The four cells are the foundation for almost every classification metric โ€” including precision & recall, next.
Try It ยท Chapter 3

Tune the Spam Threshold โš–๏ธ

๐Ÿ•น๏ธ๐Ÿ”ด real spam, ๐ŸŸข real email. Slide the line โ€” everything to its right is flagged as spam. Goal: watch precision & recall trade off. Low = catch all (recall โ†‘), high = only the obvious (precision โ†‘). Both extremes โ†’ +5โญ.
โ† less spammymore spammy โ†’
๐ŸŽฏ Recall
โ€”
๐Ÿ” Precision
โ€”
โ€”
Recall = of all real spam, how many caught (TPรท(TP+FN)). Precision = of all flagged, how many right (TPรท(TP+FP)). Push one up, the other drops โ€” a trade-off.
Try It ยท Chapter 3

Sort the Predictions ๐Ÿ”ข

๐Ÿ•น๏ธThe model is detecting cats. Drag each outcome into its cell. Goal: read a confusion matrix โ€” โ€œtrueโ€ = the model was right, โ€œpositiveโ€ = it said yes. Correct โ†’ +5โญ.
Said "cat" โ€” and it IS a cat
Said "not cat" โ€” and it ISN'T
Said "cat" โ€” but it isn't (Type I)
Said "not cat" โ€” but it is (Type II)
โœ… True Positive
โœ… True Negative
โŒ False Positive
โŒ False Negative
Try it yourself first, ya. "True" = the model was right; "Positive" = it said yes.

Feature Importance & Explainable AI ๐Ÿ“Š

Vertex AI shows a bar chart of feature importance โ€” how much each feature contributes to a prediction. Longer bar = more important.

Example โ€” predicting customer churn
Contract length
0.94
Monthly charges
0.71
Tenure
0.55
Tech support
0.33
Customer gender
0.05
Contract length drives the prediction most; gender barely matters โ€” a feature you could drop. This is part of Explainable AI โ€” tools to understand & interpret what a model is doing.
Chapter 4 ยท Model Serving

Stage 3 โ€” Serve the Meal ๐Ÿฝ๏ธ

Two steps: deploy the model (serve the dish), then monitor it (check it's running well). Model management runs across the whole workflow.

โšก

Online

Deploy to an endpoint ยท real-time, low latency ยท instant recommendations

๐Ÿ“ฆ

Batch

No endpoint needed ยท many rows at once ยท bi-weekly campaigns

๐Ÿ“ฑ

Edge

Off-cloud, on a device ยท low latency, privacy, offline ยท factory camera

Online needs an endpoint; batch doesn't. Monitoring is automated by Vertex AI Pipelines โ€” it warns you when something crosses a threshold.
Try It ยท Chapter 4

Online, Batch, or Edge? โšก๐Ÿ“ฆ๐Ÿ“ฑ

๐Ÿ•น๏ธDrag each use case onto its serving mode. Goal: match by need โ€” real-time (online), scheduled bulk (batch), on-device (edge). Correct โ†’ +5โญ.
Instant product recommendation as a user browses
Marketing campaign sent every two weeks
Object detection on a factory camera, no cloud
Real-time fraud check on a card swipe
Monthly churn scoring of all customers
An app that must work offline on a device
โšก Online
๐Ÿ“ฆ Batch
๐Ÿ“ฑ Edge
Real-time โ†’ online. Scheduled bulk โ†’ batch. On-device / offline โ†’ edge. Try it first, ya.
Chapter 5 ยท MLOps & Automation

MLOps โ€” DevOps for ML ๐Ÿ”„

MLOps applies DevOps principles to ML. It solves the production pain: in ML, both data and code keep changing.

The goal: CI ยท CT ยท CDContinuous Integration, continuous Training, continuous Delivery โ€” by automating & monitoring every step.
The backbone: Vertex AI Pipelines โ€” supports Kubeflow Pipelines (KFP) and TensorFlow Extended (TFX). Already use TensorFlow on big data? Use TFX. Otherwise, KFP.

Pipelines & Components ๐Ÿงฉ

A pipeline is built from components โ€” each a self-contained piece of code that does one task. Think of a component like a function.

๐Ÿงฑ Pre-built components

reuse Google's
  • e.g. create dataset, train AutoML, create endpoint, deploy model
  • Check these first before writing your own

โœ๏ธ Custom components

your own logic
  • For special tasks โ€” e.g. a deploy threshold check
  • Each component: one single responsibility
Build the pipeline โ†’ compile it โ†’ run it. Vertex AI even has templates so you don't start from scratch.

3 Phases of MLOps Maturity ๐Ÿ“ˆ

Phase 2 โ€” Integrate connect components ยท achieve CI / CT / CD
Phase 1 โ€” Build components start automating with Pipelines SDKs
Phase 0 โ€” Manual GUI / AutoML ยท no MLOps yet
Phase 0 is not a failureIt's essential โ€” you build the workflow manually first, so you understand it before you automate it.
Chapter 6 ยท How ML Learns ยท optional

Inside a Neural Network ๐Ÿง 

Optional deep-dive. Every network โ€” DNN, CNN, RNN, even LLMs โ€” stems from the basic Artificial Neural Network (ANN). Three layers:

Output layer the prediction ลท
Hidden layer neurons ยท the "thinking"
Input layer your features go in
Each neuron is a node; the lines between them carry weights โ€” the information the network learns during training.

How It Learns โ€” The Loop ๐Ÿ”

One pass of this whole loop = one epoch. Repeat until the error stops shrinking.

1โ€“2

Weighted Sum + Activation

Combine inputs ร— weights, add non-linearity

โ†’
3โ€“4

Predict ลท

Output a guess

โ†’
5

Loss

Measure ลท vs actual y

6

Backpropagation

Find which weights to blame

โ†’
6

Gradient Descent

Nudge weights downhill

โ†ฉ
7

Repeat (Epoch)

Until loss bottoms out

Same shape as Module 1's "shrink the loss" โ€” now you've seen the machinery underneath.

Activation Functions โ€” Tap ๐Ÿ”€

๐Ÿ•น๏ธTap each card to open it โ€” ReLU, Sigmoid, Tanh, Softmax. Goal: know which fires where (binary โ†’ sigmoid, multi-class โ†’ softmax). They add the non-linearity that makes deep layers worth stacking. (Explore โ€” no points.)

๐Ÿ“ˆ ReLU

tap to expand
Negative โ†’ 0, positive โ†’ unchanged. The common workhorse for hidden layers.

ใ€ฐ๏ธ Sigmoid

tap to expand
Squashes to 0โ€“1. Used for binary classification & logistic regression.

๐ŸŒŠ Tanh

tap to expand
A shifted sigmoid โ€” outputs between โˆ’1 and +1.

๐ŸŽฏ Softmax

tap to expand
For multi-class classification โ€” outputs a probability distribution that adds up to 1.
Binary โ†’ sigmoid. Multi-class โ†’ softmax. You can mix โ€” e.g. ReLU on hidden layers, softmax on the output.

Loss, Gradient Descent & the Knobs ๐ŸŽš๏ธ

Loss vs cost: loss = error for one example; cost = error over the whole training set. MSE for regression, cross-entropy for classification.
๐Ÿ•น๏ธ๐ŸŽฎ Set a learning rate, then tap Step โ€” the ball rolls downhill toward lowest loss. Goal: find a rate that converges. Too small โ†’ it crawls; too big โ†’ it overshoots & diverges. Reach the bottom โ†’ +5โญ.
โ€”

๐Ÿ”ง Parameters

learned by the machine
  • Weights & biases
  • You only set the starting values

๐ŸŽ›๏ธ Hyperparameters

set by a human
  • Layers, neurons, activation, learning rate, epochs
  • AutoML can pick these for you
Knowledge Check ยท Module 4

Lock It In ๐Ÿงช

Q1The three ML workflow stages, in order:

Data prep โ†’ Model development โ†’ Model serving
Serving โ†’ Training โ†’ Data
Model dev โ†’ Data prep โ†’ Serving
Deploy โ†’ Monitor โ†’ Train

Q2To automate the workflow with code, you use:

A spreadsheet
Gmail
A pre-trained API
Vertex AI Pipelines

Q3Data for ML can come from:

Only BigQuery
Only local files
Only Cloud Storage
Cloud Storage, BigQuery, or local

Q4To catch as MANY spam emails as possible, optimise for:

Recall
Precision
Latency
Budget

Q5The two steps of model serving are:

Train & evaluate
Deploy & monitor
Upload & engineer
Compile & run

Q6The backbone of MLOps on Vertex AI is:

BigQuery
A pre-trained API
Vertex AI Pipelines
A spreadsheet

Q7Why do we need activation functions?

To add non-linearity
To store data
To make it slower
To delete weights

Q8One full pass of the learning loop is called:

An epoch
A neuron
A weight
A bias

Module 4 โ€” You Can Now Explainโ€ฆ โœ…

3-Stage Workflow Iterative Feature Store Confusion Matrix
Precision vs Recall Explainable AI Online / Batch / Edge MLOps ยท CI/CT/CD
Vertex AI Pipelines Components ยท 3 Phases Activation Functions Gradient Descent
Finish Module 4 in 2 stepsDo the hands-on lab first โ€” then take the graded quiz.

๐Ÿงช Step 1 ยท Lab โ€” Build an ML Model with AutoML on Vertex AI

Walk the three stages end-to-end; tune precision & recall, read feature importance. Open the lab โ†’

๐Ÿ“ Step 2 ยท Official Module 4 Quiz โ†’

After the lab, take the graded quiz on Skills Boost. skills.google โ€บ course 593 โ€บ quiz 617916

Idea โ†’ data โ†’ model โ†’ production. You can build it. ๐Ÿ”„
DAY 4 COMPLETE ๐ŸŽ‰

You built the whole thing. ๐Ÿš€

Foundations โ†’ Generative AI โ†’ Development Options โ†’ the Workflow. Four modules, the full picture of AI & ML on Google Cloud. Rest tonight, hydrate โ€” you've done the hard part.

๐Ÿงฑ

M1 + M2

Foundations & Gen AI

๐Ÿ›ค๏ธ

M3 + M4

Options & Workflow

๐ŸŽ‰

Wrap-Up โ†’

Recap & next steps