Learning area
Machine Learning
Suppose we have measurements from people we know and want to predict something about a person we haven't measured. How would we find a useful rule? We will begin there, then work through the problems that led people to develop other methods. Each section gives you a way to inspect what those methods actually do.
Need a calculation explained first? Mathematics and Programming is there to use whenever you need it.
Getting started
- Start with a PredictionSuppose we know a person's height and want to estimate their weight. How would we find a useful rule, and how would we know whether it works for someone we haven't measured? We will start with that problem, then look at predictions that choose a category instead of a number.4 lessons
- Data PreparationA model only sees the records we give it. Before fitting, we need to know what a row represents, which measurements are missing, and how categories, units, and time should be represented. We also need to keep information from the future out of a prediction about the present.11 lessons
- Choosing and Checking a ModelA model can look good on the examples we used to choose it and still make poor predictions on new data. We need a way to compare our choices without giving them access to the answers we will use for the final test.10 lessons
- Evaluating and Improving ModelsThe model has a score. What should we change next? Follow its individual mistakes, check which cases a revision helps, and keep the next assessment separate from the decisions that produced the model. Botie will help you test repairs against group errors and the conditions the service actually needs to handle.9 lessons
Understanding the methods
- Classical Machine LearningDifferent problems give us different information to work with. We might have examples with known answers, observations we want to group, or a pattern we need to find in a picture. We will work through the methods developed for these problems and why their different approaches can be useful.29 lessons
- Probabilistic Models and UncertaintyA prediction is rarely the only plausible outcome. Botie will keep track of possible outcomes, update an uncertain failure rate, and combine noisy readings. We will distinguish uncertainty about a model from variation in the next observation, then use those ideas to predict between measured locations.5 lessons
- Neural NetworksHow do a collection of connected neurons learn to make a prediction? We will start with what one artificial neuron actually does: how its weights, bias, and activation function affect its output. From there, we can connect neurons and work through how examples are used to adjust their settings.15 lessons
- Optimisation and TrainingA model learns through changes to its parameters. We will follow those changes directly, from a small batch's gradient to momentum and adaptive updates. We will also check derivatives, inspect training curves, and decide when a saved model is a better choice than the final one.5 lessons
Working with particular kinds of problems
- Computer Vision with Neural NetworksWe can write rules to find an edge or match a known pattern in a picture, but deciding which patterns matter becomes difficult as the task grows. Neural networks let us learn useful image features from examples. We will use them to recognise objects, label individual pixels, and find similar pictures.11 lessons
- Natural Language ProcessingThe words we read are comprehensible to us, but a numerical model needs some way to process them. We will start by turning text into pieces with numerical IDs. Then we can ask how a model might learn relationships between those pieces and use the surrounding words to interpret them.37 lessons
- Time Series and ForecastingTomorrow's demand is unknown when Botie needs to prepare for it. Start with a forecast that simply repeats a known value, then introduce earlier observations, repeating patterns, and fitted relationships. Every comparison will respect what could have been known at the time the forecast was made.6 lessons
- Recommendations and RankingBotie has more guides than a reader can inspect. We will work out which ones to suggest using popularity, descriptions, and shared preferences, then evaluate the short list the reader actually sees. Missing interactions and new readers need their own treatment.5 lessons
- Graphs and Relational LearningA pump's reading can depend on the network around it. Graphs let us record those connections and use neighbouring measurements as context. We will begin with the representation, then follow information through walks, aggregation, learned layers, and predictions about missing links.5 lessons
- Anomaly DetectionAn unexpected reading can mean a broken sensor, a real event, or an operating condition we have not seen before. We will compare several ways to recognise unusual records and turn their scores into an investigation rule. A high score will remain evidence to inspect, rather than a diagnosis.4 lessons
Generating and adapting models
- Large Language ModelsA language model receives some text and produces more text. To understand how, we need to look at what it was trained to predict and how earlier words influence that prediction. We will follow those steps from a single prediction to a complete response.4 lessons
- Generative ModelsRecognising a picture and creating a new one are different problems. To generate examples, a model needs to learn something about how the training examples are put together. We will look at several ways to do this, from reconstructing compressed inputs to learning how to remove noise.4 lessons
- Adapting and Evaluating Modern ModelsA trained model may be capable of many things without doing the particular job we need. We can teach it from examples, give it feedback, or provide information it did not have during training. We also need to check whether those changes actually make it more useful.4 lessons
Learning through decisions and experiments
- Reinforcement LearningBotie sometimes has to act before he knows which choice is best. We will begin with the feedback an action produces, then add changing states and rewards that arrive later. Planning with a known model and learning from observed transitions will give us two ways to improve his decisions.6 lessons
- Causal Inference and ExperimentsKnowing which plants grew well does not tell us which intervention helped them. We will examine how treatment groups were formed, design a randomised comparison, and state the assumptions needed to learn from observational records. The calculations will keep those assumptions visible.4 lessons
Building and improving agents
- AgentsA technician asks Botie about a pump, but the answer needs a manual held in another system. How can a model request that information, and who decides what it may do with it? Start with the pieces of an agent, then build the maintenance assistant using Pydantic AI, LangChain and LangGraph. As the job grows, add permission checks and guardrails, and handle calls whose replies never arrive.18 lessons
- Prompting, Evaluation and IterationBotie answers the first maintenance question correctly, then gets the next one wrong. Before rewriting the prompt, we need to understand what happened. Choose useful examples, follow the tool calls through their traces, and build tests that expose the failure. We will use Langfuse and other evaluation tools, compare candidate revisions, and carry a repair through a fresh shift without losing the behaviours that already worked.12 lessons
- Agent Guardrails and Secure DevelopmentBotie can now write code, call MCP tools and change application records. What should he be unable to do, even if a document misleads him or a proposed fix is wrong? Build the boundaries around those effects. We will inspect patches, restrict execution, check delegated authority and follow reviewed actions through retries, then test the repaired system against a different shift.9 lessons
Putting models to work
- Deploying and Maintaining ModelsA model needs to keep behaving as intended after it leaves a training script. Botie will save the full prediction procedure, check incoming records, preserve model versions, and inspect later performance. We will also work through what a useful rollback must restore.5 lessons
- Complete ProjectsBring the pieces together around a question Botie needs to answer. Each small project includes a baseline, a repeatable procedure, held-out evaluation, and cases where the method fails. The datasets are small enough to inspect, so the reasoning stays visible as the work becomes more complete.3 lessons