Lesson 6 · Machine Learning
The Machine Learning Workflow
7 min
You'll be able to
- Follow a complete ML project from data to deployment
- Understand why evaluation happens on held-out data
- Build a repeatable workflow for your own projects
A real ML project is a loop, not a single step. You gather data, explore and clean it, split it into training and test sets, train a model, evaluate it, then iterate. Only a well-performing model is worth deploying.
The loop
- Define the problem and success metric.
- Collect and clean data.
- Split into train / validation / test.
- Train candidate models.
- Evaluate on data never seen during training.
- Deploy, monitor, and iterate.
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42
)
# never evaluate on data the model trained onChallenge
Plan a project
Sketch the five-step workflow you would follow to build a model that predicts whether a loan applicant defaults.
Knowledge Check
ML workflow
You should evaluate your final model on the same data it was trained on.
The correct order of a typical ML project is:
Answer all questions to submit.