{"course":{"slug":"machine-learning-foundations","title":"Machine Learning, Foundations","url":"https://addaly.com/learn/machine-learning-foundations","level":"intermediate","track":"start"},"lesson":{"slug":"what-learning-means","title":"What a machine actually learns","url":"https://addaly.com/learn/machine-learning-foundations/what-learning-means","position":1,"of":92,"minutes":8,"answer":"Learning means adjusting the parameters of a shape you chose until a chosen error number is as small as it can be.","keyIdea":"Learning means adjusting the parameters of a shape you chose until a chosen error number is as small as it can be."},"body":{"format":"markdown","text":"## Fitting, not understanding\n\nHere are four flats in Lagos, with monthly rent in naira.\n\n| Floor area (m²) | Rent (₦/month) |\n|---|---|\n| 40 | 180,000 |\n| 55 | 240,000 |\n| 70 | 310,000 |\n| 90 | 380,000 |\n\nYou want a program that guesses the rent of a flat it has never seen. You could write rules by hand. Instead you write down a shape with blanks in it:\n\n```\nrent = w * area + b\n```\n\n`w` and `b` are the blanks. They are called parameters. Every choice of `w` and `b` is a different program. Learning is the search for the pair that works best.\n\n## \"Best\" has to be a number\n\nGuess `w = 4000`, `b = 0`. Run the four flats through it:\n\n| Area | Predicted | Actual | Off by |\n|---|---|---|---|\n| 40 | 160,000 | 180,000 | 20,000 |\n| 55 | 220,000 | 240,000 | 20,000 |\n| 70 | 280,000 | 310,000 | 30,000 |\n| 90 | 360,000 | 380,000 | 20,000 |\n\nAverage error: ₦22,500. That single number is called the **loss**. It is the only thing the machine can see about how it is doing.\n\nNow try `w = 4000`, `b = 20000`:\n\n| Area | Predicted | Actual | Off by |\n|---|---|---|---|\n| 40 | 180,000 | 180,000 | 0 |\n| 55 | 240,000 | 240,000 | 0 |\n| 70 | 300,000 | 310,000 | 10,000 |\n| 90 | 380,000 | 380,000 | 0 |\n\nAverage error: ₦2,500.\n\nThe loss fell from 22,500 to 2,500. That drop is the entire content of the word \"learning\". No insight was gained. Two numbers moved and a third number got smaller.\n\n## The three ingredients\n\nEvery supervised model, from a two-parameter line to a language model with a trillion parameters, is made of the same three things.\n\n1. **A shape with parameters.** A line. A tree of if-statements. A stack of matrix multiplications. You choose the shape.\n2. **A loss.** One number saying how wrong the current parameters are, averaged over your data. You choose the loss, and the choice matters more than people expect.\n3. **A procedure for changing the parameters to lower the loss.** For a straight line you can solve it with algebra. For anything larger you walk downhill, which is Lesson 8.\n\nThat is the whole mechanism. Everything else in this course is about doing it honestly.\n\n## What the model does not have\n\nThe fitted model has no concept of a building. Hand it `area = 500` and it will report ₦2,020,000 without hesitation, because it has never been told that flats of that size are rare, or that the market above 200 m² behaves differently. It has never been told anything. It has four rows and two knobs.\n\nThis also means the shape you picked is a hard ceiling. Suppose rents flatten out above 120 m², because very large flats sell rather than rent. A straight line cannot bend. No quantity of extra data will make `w * area + b` produce a curve: more data will only pin down the best possible straight line more precisely, and the best possible straight line is still wrong. If you want a curve, you have to pick a shape that can curve.\n\nThis is why \"which model should I use\" is a real question and not a detail. You are not asking which program is smarter. You are choosing which family of functions the search is allowed to look inside.\n\n## Parameters and hyperparameters\n\n`w` and `b` are fitted from the data. But other numbers get chosen before fitting starts: how many terms the polynomial has, how deep a tree may go, how large each downhill step is. These are **hyperparameters**. They are picked by you, by trial, and where you are allowed to run those trials is the subject of Lesson 4.\n\nKeep the distinction clear from the start. Parameters come from the data. Hyperparameters come from you."},"check":{"question":"You fit `rent = w * area + b` to 50,000 flats. The true relationship curves: rent rises steeply up to 120 m² and then almost flattens. Training finishes. What has it accomplished?","options":[{"text":"It has found the best straight line through curved data, and the curve is permanently out of reach for this model.","correct":true},{"text":"With 50,000 rows it has enough data to discover the curve on its own.","correct":false,"tempting":"Learning sounds like discovery, so it feels as though a large enough dataset should let the model outgrow the shape it was given."},{"text":"Training will drive the loss to zero if it is allowed to run long enough.","correct":false,"tempting":"Training is described as lowering the loss, so it is natural to assume the loss keeps falling toward zero rather than bottoming out at whatever the best line can manage."},{"text":"The curve is a sign the data is noisy and should be cleaned before fitting.","correct":false,"tempting":"Dirty data really is the culprit in many bad fits, so blaming the data is a habit that usually pays off. Here the data is fine and the model is the problem."}]},"prev":null,"next":{"slug":"supervised-and-unsupervised","title":"With answers, and without","url":"https://addaly.com/learn/machine-learning-foundations/supervised-and-unsupervised"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'What a machine actually learns', in Machine Learning, Foundations. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/machine-learning-foundations/what-learning-means (Accessed: 31 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"What a machine actually learns","courseTitle":"Machine Learning, Foundations","module":{"index":1,"slug":"what-learning-is","title":"What learning is, and what it is not"},"answer":null,"keyIdea":"Learning means adjusting the parameters of a shape you chose until a chosen error number is as small as it can be.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"fitting-not-understanding","runs":[{"text":"Fitting, not understanding"}]},{"t":"p","runs":[{"text":"Here are four flats in Lagos, with monthly rent in naira."}]},{"t":"table","head":[[{"text":"Floor area (m²)"}],[{"text":"Rent (₦/month)"}]],"align":["left","left"],"rows":[[[{"text":"40"}],[{"text":"180,000"}]],[[{"text":"55"}],[{"text":"240,000"}]],[[{"text":"70"}],[{"text":"310,000"}]],[[{"text":"90"}],[{"text":"380,000"}]]]},{"t":"p","runs":[{"text":"You want a program that guesses the rent of a flat it has never seen. You could write rules by hand. Instead you write down a shape with blanks in it:"}]},{"t":"code","lang":"","label":"Text","text":"rent = w * area + b"},{"t":"p","runs":[{"text":"w","code":true},{"text":" and "},{"text":"b","code":true},{"text":" are the blanks. They are called parameters. Every choice of "},{"text":"w","code":true},{"text":" and "},{"text":"b","code":true},{"text":" is a different program. Learning is the search for the pair that works best."}]},{"t":"h2","id":"best-has-to-be-a-number","runs":[{"text":"“Best” has to be a number"}]},{"t":"p","runs":[{"text":"Guess "},{"text":"w = 4000","code":true},{"text":", "},{"text":"b = 0","code":true},{"text":". Run the four flats through it:"}]},{"t":"table","head":[[{"text":"Area"}],[{"text":"Predicted"}],[{"text":"Actual"}],[{"text":"Off by"}]],"align":["left","left","left","left"],"rows":[[[{"text":"40"}],[{"text":"160,000"}],[{"text":"180,000"}],[{"text":"20,000"}]],[[{"text":"55"}],[{"text":"220,000"}],[{"text":"240,000"}],[{"text":"20,000"}]],[[{"text":"70"}],[{"text":"280,000"}],[{"text":"310,000"}],[{"text":"30,000"}]],[[{"text":"90"}],[{"text":"360,000"}],[{"text":"380,000"}],[{"text":"20,000"}]]]},{"t":"p","runs":[{"text":"Average error: ₦22,500. That single number is called the "},{"text":"loss","b":true},{"text":". It is the only thing the machine can see about how it is doing."}]},{"t":"p","runs":[{"text":"Now try "},{"text":"w = 4000","code":true},{"text":", "},{"text":"b = 20000","code":true},{"text":":"}]},{"t":"table","head":[[{"text":"Area"}],[{"text":"Predicted"}],[{"text":"Actual"}],[{"text":"Off by"}]],"align":["left","left","left","left"],"rows":[[[{"text":"40"}],[{"text":"180,000"}],[{"text":"180,000"}],[{"text":"0"}]],[[{"text":"55"}],[{"text":"240,000"}],[{"text":"240,000"}],[{"text":"0"}]],[[{"text":"70"}],[{"text":"300,000"}],[{"text":"310,000"}],[{"text":"10,000"}]],[[{"text":"90"}],[{"text":"380,000"}],[{"text":"380,000"}],[{"text":"0"}]]]},{"t":"p","runs":[{"text":"Average error: ₦2,500."}]},{"t":"p","runs":[{"text":"The loss fell from 22,500 to 2,500. That drop is the entire content of the word “learning”. No insight was gained. Two numbers moved and a third number got smaller."}]},{"t":"h2","id":"the-three-ingredients","runs":[{"text":"The three ingredients"}]},{"t":"p","runs":[{"text":"Every supervised model, from a two-parameter line to a language model with a trillion parameters, is made of the same three things."}]},{"t":"ol","start":1,"items":[[{"text":"A shape with parameters.","b":true},{"text":" A line. A tree of if-statements. A stack of matrix multiplications. You choose the shape."}],[{"text":"A loss.","b":true},{"text":" One number saying how wrong the current parameters are, averaged over your data. You choose the loss, and the choice matters more than people expect."}],[{"text":"A procedure for changing the parameters to lower the loss.","b":true},{"text":" For a straight line you can solve it with algebra. For anything larger you walk downhill, which is Lesson 8."}]]},{"t":"p","runs":[{"text":"That is the whole mechanism. Everything else in this course is about doing it honestly."}]},{"t":"h2","id":"what-the-model-does-not-have","runs":[{"text":"What the model does not have"}]},{"t":"p","runs":[{"text":"The fitted model has no concept of a building. Hand it "},{"text":"area = 500","code":true},{"text":" and it will report ₦2,020,000 without hesitation, because it has never been told that flats of that size are rare, or that the market above 200 m² behaves differently. It has never been told anything. It has four rows and two knobs."}]},{"t":"p","runs":[{"text":"This also means the shape you picked is a hard ceiling. Suppose rents flatten out above 120 m², because very large flats sell rather than rent. A straight line cannot bend. No quantity of extra data will make "},{"text":"w * area + b","code":true},{"text":" produce a curve: more data will only pin down the best possible straight line more precisely, and the best possible straight line is still wrong. If you want a curve, you have to pick a shape that can curve."}]},{"t":"p","runs":[{"text":"This is why “which model should I use” is a real question and not a detail. You are not asking which program is smarter. You are choosing which family of functions the search is allowed to look inside."}]},{"t":"h2","id":"parameters-and-hyperparameters","runs":[{"text":"Parameters and hyperparameters"}]},{"t":"p","runs":[{"text":"w","code":true},{"text":" and "},{"text":"b","code":true},{"text":" are fitted from the data. But other numbers get chosen before fitting starts: how many terms the polynomial has, how deep a tree may go, how large each downhill step is. These are "},{"text":"hyperparameters","b":true},{"text":". They are picked by you, by trial, and where you are allowed to run those trials is the subject of Lesson 4."}]},{"t":"p","runs":[{"text":"Keep the distinction clear from the start. Parameters come from the data. Hyperparameters come from you."}]}],"check":{"question":[{"text":"You fit "},{"text":"rent = w * area + b","code":true},{"text":" to 50,000 flats. The true relationship curves: rent rises steeply up to 120 m² and then almost flattens. Training finishes. What has it accomplished?"}],"options":[{"text":[{"text":"It has found the best straight line through curved data, and the curve is permanently out of reach for this model."}],"correct":true,"tempting":null},{"text":[{"text":"With 50,000 rows it has enough data to discover the curve on its own."}],"correct":false,"tempting":[{"text":"Learning sounds like discovery, so it feels as though a large enough dataset should let the model outgrow the shape it was given."}]},{"text":[{"text":"Training will drive the loss to zero if it is allowed to run long enough."}],"correct":false,"tempting":[{"text":"Training is described as lowering the loss, so it is natural to assume the loss keeps falling toward zero rather than bottoming out at whatever the best line can manage."}]},{"text":[{"text":"The curve is a sign the data is noisy and should be cleaned before fitting."}],"correct":false,"tempting":[{"text":"Dirty data really is the culprit in many bad fits, so blaming the data is a habit that usually pays off. Here the data is fine and the model is the problem."}]}],"order":[3,0,2,1],"why":null},"prev":null,"next":{"slug":"supervised-and-unsupervised","title":"With answers, and without","minutes":7}}}