
Machine learning is a branch of artificial intelligence in which a program improves its performance on a task by learning from data rather than following hand-written rules.
The basic idea
A model is a mathematical function with adjustable parameters. During training, the parameters are tuned so that the model's output matches known correct answers as closely as possible. The difference between prediction and truth is measured by a loss function, and an optimisation algorithm reduces that loss step by step.
Types of learning
- Supervised learning — the data includes labels. Used for spam detection, price prediction, medical diagnosis support.
- Unsupervised learning — no labels; the model finds structure, such as customer segments or anomalies.
- Reinforcement learning — an agent learns by acting in an environment and receiving rewards. Used in games, robotics and control systems.
Overfitting and generalisation
The central problem is generalisation: performing well on data the model has never seen. A model that memorises its training examples but fails on new ones is overfitted.
Standard defences:
- splitting data into training, validation and test sets;
- regularisation, which penalises unnecessary complexity;
- cross-validation;
- collecting more and more varied data.
Why data quality dominates
In practice, the quality and representativeness of the data usually matter more than the choice of algorithm. Errors in labels, missing groups of users, or measurements taken under one condition and applied to another are the most common causes of failure in deployed systems.
Evaluation
Accuracy alone can be misleading. If only one per cent of transactions are fraudulent, a model that always answers "not fraud" is 99% accurate and completely useless. Metrics such as precision, recall and the confusion matrix give a truer picture.