ML and deep learning: enough to be dangerous
Judge a classifier by its errors as well as its accuracy.
In this lesson · 01 of 10
All lessons in this track →Saved in this browser. View your learning.
Start with the idea
Judge a classifier by its errors as well as its accuracy.
Count correct and incorrect predictions against known labels. Different mistakes can have different consequences. Training progress alone does not decide whether a system is suitable for use.
Classifier: A model or rule that assigns an input to a category.
See the example and check your understanding
A made-up teaching example
The toy example has four cases: two correct predictions and two mistakes. Accuracy is one half. One missed positive and one false alarm can still matter differently to the task.
Ask yourself
Does the same accuracy score mean two systems have the same risk?
Show the explanation
No. Inspect which errors occurred and what each would cause. Keep test data separate from data used to fit the model.
Start with these checks
- Check counts and the totals you divide by.
- Prevent information leaking from test data into training.
- Judge error costs for the actual task.
Use the different practice case below and check every requirement in its full instructions.
The video explains the main idea. Use the sources, instructions and checks below to complete the practice.
Captions appear here during playback.
ML and deep learning: enough to be dangerous
Judge a classifier by its errors as well as its accuracy.
Video playback is unavailable. Read the descriptive transcript below, go directly to practice, or open the video file.
Source-based teaching example · Fictional data · Reviewed 2026-10-03. Microsoft Mark · locally synthesized. On a small screen, use fullscreen for diagram details or read the transcript.
Read the descriptive transcript
0:00 · What you will learn
Judge a classifier by its errors as well as its accuracy.
What appears on screen
Judge a classifier by its errors as well as its accuracy.
0:06 · The idea
Count correct and incorrect predictions against known labels. Different mistakes can have different consequences. Training progress alone does not decide whether a system is suitable for use.
What appears on screen
Count correct and incorrect predictions against known labels. Different mistakes can have different consequences. Training progress alone does not decide whether a system is suitable for use.
0:21 · One useful term
Classifier. A model or rule that assigns an input to a category.
What appears on screen
A model or rule that assigns an input to a category.
0:29 · A worked example
The toy example has four cases: two correct predictions and two mistakes. Accuracy is one half. One missed positive and one false alarm can still matter differently to the task.
What appears on screen
The toy example has four cases: two correct predictions and two mistakes. Accuracy is one half. One missed positive and one false alarm can still matter differently to the task.
0:44 · Your turn to think
Does the same accuracy score mean two systems have the same risk? Pause and decide before continuing.
What appears on screen
Does the same accuracy score mean two systems have the same risk? Pause the video if you need more time.
1:01 · Why this answer works
No. Inspect which errors occurred and what each would cause. Keep test data separate from data used to fit the model.
What appears on screen
No. Inspect which errors occurred and what each would cause. Keep test data separate from data used to fit the model.
1:12 · Check 1
Check counts and the totals you divide by.
What appears on screen
Check counts and the totals you divide by.
1:17 · Check 2
Prevent information leaking from test data into training.
What appears on screen
Prevent information leaking from test data into training.
1:24 · Check 3
Judge error costs for the actual task.
What appears on screen
Judge error costs for the actual task.
1:29 · Now try a different case
Open the lesson and try its different practice case. Use every check in the full task. Watching alone does not mark the lesson complete.
What appears on screen
Open the lesson Try the new case Check and revise The full task and its requirements are in the linked lesson.
Watching explains the example. Complete the lesson practice to check what you can do. Explore all visual lessons →
Lesson preparation and outcomes
Prerequisites: Intermediate Python and evaluation.
By the end, you can: Interpret learning objectives, held-out behavior and error trade-offs without promised scores.
Worked scenario and practice feedback
On truth [1,1,0,0] with predictions [1,0,1,0], TP=1, FN=1, FP=1, TN=1 and accuracy=0.5. Different error costs can make another threshold preferable; training loss alone cannot decide deployment.
Guided and independent practice: Compute the matrix by hand or standard-library Python. Independently make entity-disjoint train/validation/test IDs and explain a leakage case.
Answer criteria: Counts and denominators correct; splits precede fitted transformations; five epochs or an architecture name does not promise an accuracy result. If the local pack or interpreter is unavailable, trace the synthetic input, expected output and failure guard on paper; label execution unverified. Required practice uses no paid API calls, accounts, purchase, operational data or actual deployment.
Tier 02 made you AI-capable. Tier 03 develops deeper design and evidence skills for applied AI scenarios; course completion does not establish job readiness. The first lesson is the ML primer you need to defend a design review, read a research paper, and tell hype from substance. We cover the minimum that pays back. The rest you can pick up in context.
Part 1 The three regimes of machine learning.
You will see these labels everywhere. Know them cold.
- Supervised learning. You give the model labeled examples: inputs paired with correct outputs. The model learns a function that maps inputs to outputs. Image classification, sentiment analysis, almost every “predict this from that” task. A common family of learning tasks.
- Unsupervised learning. No labels. The model finds structure in the data: clusters, embeddings, density estimates. K-means, dimensionality reduction (PCA, t-SNE, UMAP), embedding models. Useful as a building block; rarely the final product.
- Reinforcement learning. No labels; instead a reward signal that arrives over time. The model learns a policy that maximizes cumulative reward. Game-playing AI, robotics, RLHF. Hard to do well. Hyped beyond its actual production footprint.
LLMs sit in a hybrid. Pre-training is self-supervised (the model predicts the next token given the prior tokens, and the “label” comes from the corpus itself). Post-training can include supervised instruction tuning, preference objectives such as DPO, and reinforcement-learning approaches such as RLHF. DPO is not interchangeable with online reinforcement learning, and no undisclosed provider pipeline should be assumed. Knowing which regime is which helps you read what an LLM team is actually doing.
Part 2 Loss, gradient descent, and backpropagation: the intuition.
You don’t need to write the math. You need to know what the words mean when an ML scientist uses them.
- Loss function. A number that says how wrong the model is on a batch of examples. Lower loss means a better fit to the chosen objective on the evaluated examples; it does not guarantee factual correctness, fairness or transfer. The model trains by trying to make loss go down.
- Gradient descent. The algorithm that adjusts the model’s parameters to reduce loss. It computes which direction to nudge each parameter to make loss smaller, then nudges in that direction. Repeats until loss stops dropping (or the budget runs out).
- Backpropagation. The procedure that computes the gradient (the direction-to-nudge) across all the layers of a neural network efficiently. Uses the chain rule from calculus. The reason we can train networks with billions of parameters.
- Learning rate. How big a nudge per step. Too big and the model oscillates and doesn’t converge. Too small and it takes forever. Most modern training uses learning rate schedules that vary the rate across training.
- Batch. The number of examples processed per gradient step. Bigger batches give more stable gradients but cost more memory per step.
- Epoch. One full pass through the training data. A run may use fractional, single or repeated passes depending on corpus, mixture and objective; do not infer a proprietary training schedule.
If you can use those six words correctly in a sentence about training, you can hold a conversation with any ML team.
Part 3 The architectures you should recognize.
You will hear these names. Know what they’re for.
- MLP (multi-layer perceptron) / feedforward network. The original neural network. Stacked linear-then-nonlinear layers. Used in many architectures, including transformer feedforward sublayers.
- CNN (convolutional neural network). Built for grid data: images, video, some audio. Convolution layers detect local patterns. The default for vision until transformers showed up.
- RNN / LSTM / GRU (recurrent networks). Built for sequence data: text, audio, time series. Process tokens one at a time with hidden state. Mostly displaced by transformers in NLP, still used in some specialized contexts.
- Transformer. An important family underlying many language models; hybrids and other designs exist. Lesson 02 covers it in depth. Built on the attention mechanism; processes sequences in parallel; scales well.
- Diffusion model. A family of generative methods with disclosed implementations such as Stable Diffusion; do not infer undisclosed product internals. Generates by progressively denoising random noise toward a target.
- Mixture-of-experts (MoE). A scaling technique. A model routes each input through only some of its parameters (the “experts”), which lets you grow total parameter count without proportional compute cost.
These are examples of architecture families you may encounter; they are not a mandatory deployment stack. You do not need to implement any of them from scratch; you need to recognize them, know what they’re for, and know when a vendor or research paper is using them.
Part 4 The training-versus-inference distinction.
A confusion that traps junior engineers:
- Training. The process of adjusting the model’s parameters using data and a loss function. Computationally expensive, slow, intermittent. Compute and time depend on size, data, objective and implementation; no fixed hardware/time claim is made here.
- Inference. The process of running a trained model to get an output. Computationally cheaper per call, but production load means you do it millions of times.
Cost structure differs sharply. Training cost is amortized across the lifetime of the model and usually paid by the model provider. Inference cost is paid by your application every time it runs. Most federal AI economics is about inference, not training.
Two derived terms you should know:
- Pre-training. The big initial training pass on a large unlabeled corpus. Can include continued pre-training or repeated mixtures. It develops a base model under the stated objective.
- Post-training. Everything after pre-training: instruction tuning, RLHF, DPO, fine-tuning for a specific task. Lesson 03 covers this in depth.
Part 5 Evaluation in deep learning, briefly.
You learned eval discipline in Tier 02 Lesson 08. Two extensions matter at the Expert tier.
- Train/validation/test splits. Training data is what the model learns from. Validation is what you use to tune hyperparameters and pick checkpoints. Test is what you score on for honest performance numbers. You do not look at the test set during development; if you do, your numbers will be optimistic.
- Held-out evaluation. A test set that was constructed without the model ever seeing the data, not even indirectly through scraping. For LLMs, true held-out is hard because the training corpus may have ingested public benchmarks. The discipline is to use customer-specific eval sets the foundation model has not seen.
When you read research papers reporting “98% on MNIST” or “85% on MMLU,” the honest question is: was the test set really held out, or is it contaminated? Check benchmark provenance, contamination, uncertainty and relevance. Task-specific evidence complements general benchmarks.
Interface/reference limits
Use the workflow reference to distinguish model capability, deployment and harness controls. Provider snippets in this lesson are illustrative, have not been executed against an actual provider in this revision, and require current SDK/model capability verification before separately authorized use.