Machines, Data & Learning
An interactive, connected companion to CS7.301 — Machine, Data and Learning. Written to be read before, during and after the lectures.
This is not just a pile of notes. It is one long story about one question:
How can a machine act well in a world it doesn't fully understand, using only data and experience?
Every topic in your syllabus is one piece of the answer. Overfitting, genetic algorithms, utility theory, Markov decision processes, decision trees and Bayesian networks can look like unrelated topics in a slide deck. They are not. They are four ideas that keep meeting each other:
Meet Bolt
To keep the ideas connected, one character appears in every chapter: Bolt, a small food-delivery robot on a university campus. It carries late-night maggi from the canteen to the hostels. Bolt's problems grow as the book goes on, and each one needs the next tool:
| Chapter | Bolt's problem | The tool you'll learn |
|---|---|---|
| 1 | What does it even mean for Bolt to be "smart"? | Agents, environments, rationality |
| 2 | Predict delivery time from distance without memorising last week's noise | Generalization, overfitting, bias–variance |
| 3 | Tune 11 model weights when there is no gradient to follow | Hill climbing, simulated annealing, genetic algorithms |
| 4 | "My bump sensor fired. Is there really a pothole?" Is a risky shortcut worth it? | Probability, Bayes' rule, utility |
| 5 | Plan a route when wheels slip, and when Bolt isn't even sure where it is | Decision theory, MDPs, value iteration, POMDPs |
| 6 | Learn readable rules for "will this order be late?" | Decision trees, entropy, information gain |
| 7 | Diagnose why Bolt stopped: battery, motor or software? | Bayesian networks and inference |
How to read this book
The layout copies the Brown University version of the Rust Book, because that layout is good for learning:
- Sidebar (☰ top-left): every chapter, in order. Read them in order the first time, because later chapters build on earlier ones.
- Arrow keys ← → move between pages. s opens search.
- Themes (the paintbrush): Light, Rust, Coal, Navy, Ayu.
- Quizzes appear at the end of sections. They are written like exam questions. A quiz you can't finish tells you what to re-read. Your best scores are kept in this browser (the bar-chart icon, top right).
- Interactive widgets let you play with each idea: drag a slider until the model overfits, watch a genetic algorithm evolve, step value iteration one sweep at a time. Don't skip them. Ten seconds of playing is worth a page of reading.
- Python code is runnable and was tested with
numpy(andscipyfor one LP example). Copy it, run it, break it.
You will also see coloured boxes:
The idea explained without formulas, the way a friend would explain it.
How this idea links to other chapters. These boxes hold the story together.
Common question types, standard tricks and frequent mistakes.
Practical advice for the coding assignments, which are worth 35% of your grade.
The running example for this chapter.
How the book maps to your syllabus
| Syllabus unit | Course outcome | Where in this book |
|---|---|---|
| Unit 1 — Overview of AI and ML | CO-1 | Chapter 1 |
| Unit 2 — Data, generalization, overfitting, underfitting, bias–variance | CO-1, CO-2 | Chapter 2 |
| Unit 3 — Local search, genetic algorithms | CO-3 | Chapter 3 |
| Unit 5 — Probability and utility theory | CO-4 | Chapter 4 |
| Unit 6 — Decision theory, MDPs, modelling observation errors | CO-5 | Chapter 5 |
| Unit 7 — Decision tree learning, information gain | CO-6 | Chapter 6 |
| Unit 8 — Bayesian networks | CO-5 | Chapter 7 |
The syllabus jumps from Unit 3 to Unit 5. There is no Unit 4 in the document you were given, so this book doesn't invent one. "Modelling observation errors" in Unit 6 means sensor models, belief states and POMDPs, covered in §5.5.
The two references are Russell & Norvig, Artificial Intelligence: A Modern Approach (AIMA) and Python Machine Learning by Example (Liu). Where a section follows AIMA closely, it says which AIMA chapter to read. Many examples here, such as the 4×3 grid world, the burglar alarm and the tennis dataset, are the standard ones from AIMA and Mitchell. That's on purpose: your professors will probably use the same ones.
How your grade is built, and what that means for studying
| Component | Weight | What it rewards | How to prepare |
|---|---|---|---|
| Assignments | 35 | Implementing ideas in code and explaining your results | Every "Lab" section and Appendix B |
| Quizzes | 15 | Quick, precise understanding | The in-book quizzes |
| Mid exam | 20 | Chapters 1–4 (roughly) | Hand-computation drills + Appendix A |
| End exam | 30 | Everything, with weight on MDPs, trees and Bayes nets | Appendix C study plan |
MDL exams reward being able to compute by hand. Typical questions: one round of value iteration, the information gain of an attribute, a posterior with Bayes' rule, one GA crossover and mutation, the expected utility of a lottery, a bias–variance argument. Every chapter here includes worked examples of exactly these. Do them with a pen before you look at the answer.
A note on the math
You need high-school probability, a little calculus (derivatives) and comfort with summations like \(\sum_i x_i\). Every formula is introduced in words first. If an equation scares you, read the sentence above it again. The equation is only a short way of writing that sentence.
Ready? Let's start with the biggest question: what is AI, anyway?