What Is Machine Learning?
You could price flats with a formula you invent yourself: "₹0.3 thousand per square metre, plus 1 per room, minus 1 per kilometre from the metro." It works on some flats and fails on others, and every time the market shifts you must rewrite it. Machine learning flips the job around: you supply past flats and their real rents, and the program works out the formula.
The rule
Don't write the rules; show examples and let the program find them.
In ordinary programming, a person writes rules, the program applies them to data, and answers come out. In machine learning, data and answers go in, and rules come out. Those learned rules are the model.
The vocabulary, on our flats table:
- Example (or instance): one flat, one row.
- Features: the inputs describing it: size, rooms, metro distance.
- Label (or target): the answer to learn: the rent.
- Model: a function with adjustable numbers, called parameters or weights, such as .
- Training: adjusting the weights to shrink a loss that measures how wrong the predictions are. This is where the gradients from the calculus section do their work.
- Prediction (or inference): using the trained model on a new flat.
The real test is generalisation: doing well on flats the model has never seen. So the data is split. The model learns from a training set, and a separate test set is kept aside to measure it honestly. A model that scores perfectly on training flats but badly on new ones has memorised rather than learned; that is called overfitting.
ML is not always the right tool. If the rule is known exactly (GST at a fixed rate, a deposit of two months' rent), just write it. ML earns its place when the rules are too complex or too changeable to write down and there is enough data to learn them.
The shortcut
Find the four nouns: examples, features, label, model. If you can name all four for a problem, you can frame it as machine learning. If there is no label, it is still ML, but a different kind (later lessons).
Examples
Every flat the agency listed in the past two years.
Drills
Answer fast — trust the rule.
In the rent model, what is "number of rooms"?
In the training data, what is each flat's actual rent?
Which agency problem least needs machine learning?
A model scores perfectly on its training flats but badly on new flats. What went wrong?
Remember
- Don't write the rules; show examples and let the program find them.
- Shortcut: name the examples, features, label and model.
- Trap: judging a model on the data it trained on.
