Lesson 6 — Recap and FAQ
The five lessons in one page
Lesson 1 — the families. Supervised learning has the answers attached, which makes it measurable and dominant in production, split into classification and regression. Unsupervised learning finds structure with no ground truth, so its output needs interpretation. Reinforcement learning learns from delayed rewards and needs cheap mistakes, while self-supervised learning invents its own labels and made language models possible.
Lesson 2 — the algorithms. About six families cover practice, and the right one follows the shape of your data: gradient boosting on tables, linear models when explanation matters, deep learning on raw images, text and audio. No algorithm wins everywhere, so trying several is the only reliable method.
Lesson 3 — the features. A model only exploits what is in its input, and the columns in your database are rarely the features you want. Constructing them is where domain knowledge enters, and the test that keeps a project alive is whether each feature will be available, computed identically, at prediction time.
Lesson 4 — the evaluation. Split first, decide on the validation set, look at the test set once. Cross-validation gives an average and a spread, time-ordered data must be split chronologically, and every result must be compared against a trivial baseline.
Lesson 5 — the failures. Leakage, unrepresentative data, the training-serving gap, silent drift, and feedback loops where the model shapes the data that trains its successor. All five are invisible in a notebook.
A project checklist
Steps 1 and 2 are the ones most often skipped, and skipping them is why projects finish with a model nobody deploys. If you cannot say what decision the model will change and what success looks like numerically, the modelling is premature.
The 12 questions people actually ask
1. Is machine learning always better than rules?
No. Rules are deterministic, explainable, free to run and trivial to audit. Machine learning earns its complexity when the pattern is too subtle or too varied to enumerate, or when it changes over time. A good number of production systems are best served by a handful of rules plus a model for the ambiguous remainder.
2. How much data do I need?
For a classical model on a table, a few hundred to a few thousand rows is a genuine start, provided they are representative and correctly labelled. Quality dominates quantity: a thousand carefully labelled rows beat fifty thousand where the labels were guessed, because the model will faithfully learn the guesswork.
3. What are hyperparameters and how do I tune them?
Hyperparameters are settings you choose rather than learn: tree depth, learning rate, regularisation strength. Tune them on the validation set, never the test set. Start with a random search over a wide range rather than an exhaustive grid, since random search finds good regions faster when only a few settings actually matter — which is usually the case.
4. Should I use AutoML?
It is genuinely useful for establishing a strong baseline quickly, and it will not save a badly framed problem or leaky features. AutoML searches models and settings; it does not question whether your target is the right target or whether a feature could exist in production. It automates the part that was already the easy part.
5. My model gets 99% accuracy. Should I be pleased?
Be suspicious. Check the class balance first, because 99% on a problem where 99% of cases are negative means the model detected nothing. Then audit for leakage. An unexpectedly excellent first result is more often a mistake in the setup than a breakthrough.
6. How do I explain a model to non-technical stakeholders?
Lead with what decision it changes and what it costs when wrong, not with the algorithm. Show the confusion matrix in their language: out of a hundred cases like yours, it catches this many and raises this many false alarms. Then show which features drove it. Feature importance and tools such as SHAP exist for exactly this conversation.
7. What is the difference between a model and a pipeline?
The model is the trained estimator. The pipeline is everything around it: imputation, encoding, scaling, then the model. What you deploy must be the pipeline, because raw production data needs the same preparation as training data. Deploying only the model is how the training-serving gap opens.
8. How often should I retrain?
It depends on how fast your domain moves. Fraud and recommendation may need daily or weekly retraining; a physical process may be stable for a year. Rather than guessing a schedule, monitor performance and input distributions and retrain when they move. Decide the trigger before deployment, or retraining will happen when someone complains.
9. Can I trust feature importance?
As a description of what the model used, yes. As a statement about cause, no — it remains correlation. And when two features are strongly correlated, the model may lean on one arbitrarily, making the other look unimportant even though it carries the same information.
10. What is an ensemble, and should I always use one?
An ensemble combines several models to reduce error, and gradient boosting and random forests are ensembles already. Stacking further models on top brings diminishing returns and real operational cost. Get the features and the evaluation right before reaching for ensemble complexity.
11. How do I handle a very imbalanced dataset?
Change the metric first: use precision, recall and precision-recall AUC rather than accuracy. Then consider class weights, which tell the model that errors on the rare class cost more. Resampling techniques can help and can also create synthetic examples that do not resemble reality, so validate carefully. Above all, evaluate on the natural imbalance, never on a rebalanced test set.
12. Where should I go after this course?
Deep Learning when your data becomes images, text or audio, and MLOps to keep a deployed model working, which is where lesson 5's failures are addressed properly. Ethics of AI covers what you owe the people your model affects.
The premium catalogue takes you through real datasets, working notebooks and finished projects, with a verifiable certificate after a 40-question examination. Included in every paid plan.
Last step — Take the quiz and see your attestation →