From idea to a working model
A model that works in a notebook is not a solution. In this quest you take one through its whole life: business goal โ data โ training โ evaluation โ deployment โ monitoring, the way Amazon did for its call centre.
This is your warm-up. After this quest, the full Day 3 notes will feel easy.
Your progress wheel: clear a level to light up a segment
The ML lifecycle
Goal: name the 7 phases and say what happens in each.
It is a loop, not a straight line. You go back and improve again and again.
Tap a phase
Explore all 7 phases to earn XP.
Explored 0 of 7
Business goal โ Problem framing โ Data โ Model โ Deploy โ Monitor โ Retrain
โBright People Design Models, Deploy, Monitor, Repeat.โ
๐ Checkpoint
Where does every ML project start?
The model is live but accuracy is slipping. Which phase?
Real story: the Amazon call centre
Goal: follow one real project through the whole lifecycle.
๐ The problem
โPress 1 for Returns. Press 2 for Kindle. Press 3 forโฆโ. Amazon sells almost everything, so the menu could never cover it all. Customers picked the wrong option, reached the wrong agent, and got transferred again and again. With hundreds of millions of calls a year, that wasted time and money, and annoyed customers.
Features they used
What were the customerโs recent orders? Does the customer own a Kindle? Are they a Prime member?
The label
The agent skill that actually solved the call.
Smart data cleaning
Several Kindle skills became one โKindleโ label. Fewer, cleaner labels = simpler model.
Tuning the learning rate
Too fast: never settles on a good answer. Too slow: never gets there in time.
๐ Checkpoint
โWhich of 20 agent skills should this call go to?โ isโฆ
Past calls already had the right skill recorded. So this isโฆ
Split your data
Goal: explain why we hold data back, and what each split is for.
Training set
The model learns from this.
Validation set
Check and improve: tune hyperparameters, compare versions.
Test set
The final, honest check. Used once, at the very end.
๐ Checkpoint
Which set is used to tune hyperparameters?
Why not evaluate on the training data?
Amazon SageMaker AI: one tool per phase
Goal: match each SageMaker AI feature to its lifecycle phase.
Data Wrangler
- Low-code / no-code: import, clean, transform, analyse
- Add your own Python steps
Processing API, EMR, AWS Glue
- Run scripts and notebooks on managed infrastructure
- scikit-learn, MXNet, PyTorch
Feature Store
- Create, share and reuse features
- Same features for training and inference
Training jobs
- Built-in or custom algorithms
- Model artifacts saved to Amazon S3
SageMaker Canvas
- No-code predictions and AutoML
SageMaker JumpStart
- Pre-trained open-source models and solution templates
SageMaker Experiments
- Track data, algorithms and parameters
- See the effect of each change on accuracy
Automatic Model Tuning
- Runs many jobs with different hyperparameters
- Picks the best by your chosen metric
Inference options
- Real-time, batch, asynchronous, serverless (level 8)
Model Monitor
- Continuous or scheduled checks
- Alerts on data quality, model quality, bias drift, feature attribution drift
Where you work: SageMaker Studio
A web interface that opens everything: prepare data, train, deploy, monitor. Inside it you can use:
๐ JupyterLab
Notebooks, code and data.
๐ฑ๏ธ Canvas
No-code ML and AutoML.
๐ RStudio
For the R language.
๐ป Code Editor
Based on VS Code, with extensions.
๐ JumpStart
Pre-trained models to start from.
โ๏ธ Model evaluations
Check LLM quality and responsible AI.
๐ Checkpoint
You want to clean and transform data with almost no code. Useโฆ
Run many training jobs with different hyperparameters and keep the best:
Where do models come from?
Goal: choose between a ready model and building your own.
Four ways to get a model in SageMaker AI, from least effort to most:
๐ Pre-trained models (JumpStart)
Least effort. Deploy as-is, or fine-tune first. From popular model hubs, with ready-made solution templates.
๐งฐ Built-in algorithms
More effort. AWS provides the algorithm; you bring the data. Scales well to large datasets.
๐ Your code in a pre-made image
No built-in fits? Write your own script using scikit-learn, TensorFlow, PyTorch, MXNet or Chainer in an AWS-provided container.
๐ณ Your own Docker image
Most effort, most control. Install anything you need.
Built-in algorithms by problem type
Supervised
Classification and regression: predict a label or a number.
Unsupervised
Clustering, dimension reduction, topic modelling, anomaly detection.
Image processing
Image classification, object detection, computer vision, time series.
Text analysis
Document classification and summarisation, topic modelling, transcription and translation.
The notes list only the most common ones. The SageMaker AI documentation has the full list.
๐ Checkpoint
Which option needs the least effort?
You need an unusual library that no AWS image has. Useโฆ
Model fitting: the three students
Goal: spot underfitting and overfitting, and know the fixes.
Three students, three models
| Model | Training accuracy | Testing accuracy | Bias | Variance | Generalisation |
|---|---|---|---|---|---|
| Underfitting | Low | Low | High | Low | Poor |
| Good fit | High | High | Moderate | Moderate | Excellent |
| Overfitting | Very high | Low | Low | High | Poor |
Bias
Error from assuming things are too simple. The model canโt capture the real relationship.
Variance
Sensitivity to the exact training examples. Change the data a little and the model changes a lot.
Fix underfitting
More complex model (linear โ polynomial or random forest), add features, train longer, reduce regularisation.
Fix overfitting
More data, cross-validation, simpler model, regularisation (L1/L2), prune trees, dropout, early stopping, feature selection, ensembles.
| Algorithm | Underfitting risk | Overfitting risk |
|---|---|---|
| Linear regression | High | Low |
| Decision tree | Low | Very high |
| Random forest | Low | Low |
| XGBoost | Low | Medium |
| KNN, small K | Low | High |
| KNN, large K | High | Low |
| Neural network | Low | High without regularisation |
๐ Checkpoint
Training loss keeps falling while validation loss rises. This isโฆ
High bias and low variance meansโฆ
Measuring a model
Goal: read a confusion matrix and pick the right metric.
Evaluation happens after training, on the validation and test sets. Which numbers you look at depends on the problem type.
Precision
Of everything it flagged, how much was right? Low precision = real mail lands in spam.
Recall
Of all the real spam, how much did it catch? Low recall = spam in your inbox.
F1 score
One number balancing precision and recall.
AUC
How well the model separates the two classes across all thresholds.
Predicting numbers instead? Use regression metrics
MAE
Average size of the error, in the same unit (โน, ยฐC).
RMSE
Like MAE but punishes big mistakes much more.
Rยฒ
How much of the variation the model explains. 1.0 is perfect.
๐ Checkpoint
A cancer screening model must not miss sick patients. Optimiseโฆ
Predicting house prices in rupees. A good metric isโฆ
Deploy it, then keep it alive (MLOps)
Goal: choose a deployment option and explain what MLOps adds.
Self-hosted API
Your own servers or containers. Full control, maybe cheaper, but you manage web servers, load balancers and databases.
Managed API
SageMaker AI hosts it: one click or one API call, automatic scaling, HTTPS endpoints that can hold several models.
Four SageMaker AI inference options
Real-time
Interactive, low latency. A live endpoint.
Batch transform
Big datasets, no permanent endpoint. Also good for cleaning data before training.
Asynchronous
Queues requests. Large payloads (up to 1 GB), long processing (up to 1 hour).
Serverless
Quiet periods between spikes, and you can accept a cold start. No infrastructure to manage.
MLOps = people + process + technology
5 benefits
โก Productivity
Self-service environments and curated data. Less waiting.
โ Reliability
CI/CD means quick deployments with consistent quality.
๐ Repeatability
Automate every step, so results can be reproduced.
๐ Auditability
Version data, code and models: show exactly how a model was built.
๐ Data and model quality
Enforce policies against bias, track drift over time.
๐ค Collaboration
Data scientists, engineers and IT operations working as one team.
4 key principles
๐๏ธ Version control
Track changes to data, code and models. Roll back when needed.
๐ค Automation
Automate ingestion, preprocessing, training, validation and deployment. Automated tests catch problems early.
๐ CI/CD
Continuous integration, delivery, training (retrain automatically) and monitoring.
๐๏ธ Model governance
Documentation, reviews and approvals before deployment. Check fairness, bias and ethics. Protect sensitive data.
AWS services for MLOps
| Step | Service |
|---|---|
| Prepare data | SageMaker Data Wrangler, Processing API |
| Store features | SageMaker Feature Store |
| Train | SageMaker training jobs |
| Compare runs | SageMaker Experiments |
| Process and evaluate | SageMaker Processing |
| Catalogue and approve models | SageMaker Model Registry |
| Deploy | SageMaker inference options |
| Monitor | SageMaker Model Monitor |
| Tie it all together | SageMaker Model Building Pipelines |
๐ Checkpoint
Requests up to 1 GB that take several minutes needโฆ
Which MLOps principle lets you prove how a model was built?
The big picture: mind map
Everything on one page. Click a branch to jump to its level.
Flashcards
Tap to flip. Mark each card. Keep going until the โreview againโ pile is empty.
Myth or fact?
Quick-fire. Decide fast.
Boss battle
10 questions. 3 hearts. Can you beat the Drift Monster?
Quest progress
ML Solutions Builder
๐ Next step: read the Day 3 notes
You know the map now. In the notes, look for:
- The exact wording of the 7 lifecycle phases
- The full Amazon call centre story, phase by phase
- Every SageMaker AI feature and what it does
- The complete underfitting / good fit / overfitting comparison tables
- The MLOps benefits, principles and AWS service map