Skills / Machine learning basics / What machine learning is

Machine learning basics, lesson 1 of 8

What machine learning is

In normal programming, you write the rules: "if the email contains these words, mark it as spam." In machine learning, you give the computer many examples, such as thousands of emails already labelled spam or not spam, and it finds the patterns itself. The result is a model: a learned rule that can make predictions about new examples it has never seen.

The main kinds:

  • Supervised learning: examples come with the right answer (the label). The model learns to predict the label.
    • Classification predicts a category: spam or not, which product category, will this customer cancel (yes or no)
    • Regression predicts a number: house price, delivery time, next month's sales
  • Unsupervised learning: no labels. The model finds structure by itself, for example grouping customers with similar buying habits (clustering)
  • Reinforcement learning: an agent learns by trial and error from rewards, as used in game playing and robotics

Words you will meet:

  • Features: the input facts the model uses (size, location, number of rooms)
  • Label or target: what you want to predict (the price)
  • Training: the model adjusting itself to fit the examples

What it is not. A model only knows patterns in the data it was trained on. If the data is biased, incomplete or out of date, the predictions will be too. Machine learning is powerful pattern matching, not understanding.

Many business problems do not need machine learning at all; a simple rule or a good report often wins. Use it when patterns are too complex to write by hand and you have plenty of good examples.

Try it: For each task, say whether it is classification, regression or clustering: (1) predict tomorrow's temperature, (2) decide if a photo shows a cat or a dog, (3) group shoppers by buying habits, (4) estimate a used car's price.

Check yourself

1. What does supervised learning need?

2. Predicting a house price is an example of what?

3. If training data is biased, what happens to the model?