Skip to the workspace
Pebellslearn by building
Types of Machine Learning  ›  Lesson

What Is Machine Learning?

What is Machine Learning? 12 minMachine learning finds the rules from examples instead of having a programmer write them, and the result must work on examples it has never seen.

machine learning / What Is Machine Learning?

Explore each scene at your own pace.

01 · The rule

The rule

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 rent≈w1⋅size+w2⋅rooms+w3⋅metro+b\text{rent} \approx w_1 \cdot \text{size} + w_2 \cdot \text{rooms} + w_3 \cdot \text{metro} + b.
  • 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.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.