Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
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.

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.

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).

Framing "will this flat rent within a week?"Step 1 of 4
  1. Examples

    Every flat the agency listed in the past two years.

Drills

Answer fast — trust the rule.

quick drill

In the rent model, what is "number of rooms"?

quick drill

In the training data, what is each flat's actual rent?

quick drill

Which agency problem least needs machine learning?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainRules or examples?

Explain the difference between hand-writing a rent formula and learning one with machine learning. Use the words example, feature, label and model, and describe one problem at the agency where machine learning would be the wrong tool.