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:

① Learning from data Ch 1–2: generalization, overfitting, bias–variance, validation "Fit the pattern, not the noise." ② Search & optimization Ch 3: hill climbing, annealing, genetic algorithms "Find the best model / plan." ③ Reasoning under uncertainty Ch 4 & 7: probability, Bayes' rule, Bayesian networks "Believe the right amount." ④ Making decisions Ch 4–6: utility, MDPs, POMDPs, decision trees "Act to maximize expected utility." GA tunes models loss = objective noise ⇒ probability search over plans beliefs feed choices
The whole course on one page. Come back to this map whenever a topic feels isolated.

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:

ChapterBolt's problemThe tool you'll learn
1What does it even mean for Bolt to be "smart"?Agents, environments, rationality
2Predict delivery time from distance without memorising last week's noiseGeneralization, overfitting, bias–variance
3Tune 11 model weights when there is no gradient to followHill 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
5Plan a route when wheels slip, and when Bolt isn't even sure where it isDecision theory, MDPs, value iteration, POMDPs
6Learn readable rules for "will this order be late?"Decision trees, entropy, information gain
7Diagnose 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 (and scipy for one LP example). Copy it, run it, break it.

You will also see coloured boxes:

Intuition

The idea explained without formulas, the way a friend would explain it.

Connections

How this idea links to other chapters. These boxes hold the story together.

Exam corner

Common question types, standard tricks and frequent mistakes.

Lab / assignment skills

Practical advice for the coding assignments, which are worth 35% of your grade.

Bolt's problem

The running example for this chapter.

How the book maps to your syllabus

Syllabus unitCourse outcomeWhere in this book
Unit 1 — Overview of AI and MLCO-1Chapter 1
Unit 2 — Data, generalization, overfitting, underfitting, bias–varianceCO-1, CO-2Chapter 2
Unit 3 — Local search, genetic algorithmsCO-3Chapter 3
Unit 5 — Probability and utility theoryCO-4Chapter 4
Unit 6 — Decision theory, MDPs, modelling observation errorsCO-5Chapter 5
Unit 7 — Decision tree learning, information gainCO-6Chapter 6
Unit 8 — Bayesian networksCO-5Chapter 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

ComponentWeightWhat it rewardsHow to prepare
Assignments35Implementing ideas in code and explaining your resultsEvery "Lab" section and Appendix B
Quizzes15Quick, precise understandingThe in-book quizzes
Mid exam20Chapters 1–4 (roughly)Hand-computation drills + Appendix A
End exam30Everything, with weight on MDPs, trees and Bayes netsAppendix C study plan
Exam corner

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?