Machine learning (ML) studies algorithms whose performance on a task improves as they are exposed to more data. Instead of writing rules by hand, we show the program examples and let it discover the rules.
What Machine Learning Means
In 1959 Arthur Samuel described machine learning as the field that gives computers the ability to learn without being explicitly programmed. A more precise definition was given by Tom Mitchell in 1997: a program is said to learn from experience E with respect to a task T and a performance measure P, if its performance at T, as measured by P, improves with experience E. For a spam filter, the task T is to label an email as spam or not spam, the experience E is a collection of emails already labelled by users, and the performance P is the percentage of emails classified correctly.
Definition: Machine learning. A field of study in which a program improves its performance at a task, measured by some metric, by learning from experience in the form of data, rather than by following rules written explicitly by a programmer.
Traditional Programming versus Machine Learning
In traditional programming the programmer supplies data and rules, and the program produces answers. In machine learning the programmer supplies data and the answers, and the learning algorithm produces the rules, usually called a model. The model is then applied to new data. This approach is valuable when the rules are too many or too complex to write by hand, as in recognising a face, when the rules change over time, as in fraud, or when the problem is not fully understood by humans.
A Short History
The history of the subject is a series of waves of progress and disappointment.
- 1943: McCulloch and Pitts propose a mathematical model of the neuron.
- 1950: Alan Turing asks whether machines can think.
- 1952 to 1959: Samuel writes a checkers program that learns to beat its author.
- 1957: Frank Rosenblatt builds the perceptron, the first trainable neural network.
- 1969: Minsky and Papert show the limits of single-layer perceptrons, and funding falls.
- 1980s: back-propagation revives neural networks; Quinlan's ID3 (1986) popularises decision trees.
- 1995: Cortes and Vapnik introduce the support vector machine.
- 2012: deep convolutional networks win the ImageNet contest by a large margin.
- 2017 onwards: transformer models lead to modern language and generative systems.
Applications
Machine learning is now present in everyday products: spam filtering, product and video recommendation, speech recognition, language translation, face unlock, credit-card fraud detection, medical image analysis, demand and price forecasting, and driver assistance. Banks use it for credit scoring, hospitals for diagnosis support, farmers for crop disease detection and telecom companies for predicting customer churn.
Table 1.1: Traditional programming and machine learning
| Aspect | Traditional programming | Machine learning |
|---|---|---|
| Input | Data and hand-written rules | Data and the known answers |
| Output | Answers | Rules (a model) |
| Best for | Clear, stable rules | Complex or changing patterns |
| Adapts to new data | No, rules must be edited | Yes, by retraining |
| Example | Computing income tax | Detecting spam email |
Example 1.1: Learning a spam rule from data
Problem: The number of links in eight emails is 0, 1, 1, 2, 3, 5, 6, 8 and their labels (1 = spam) are 0, 0, 0, 1, 0, 1, 1, 1. Learn the best threshold t, where an email is called spam if links >= t.
Solution:
- Try t = 2: the emails with 2, 3, 5, 6, 8 links are called spam. Only the email with 3 links is wrong, so there is 1 error.
- Try t = 3: the emails with 3, 5, 6, 8 links are spam. The email with 2 links (spam) is missed and the one with 3 links is wrong, so there are 2 errors.
- Smaller thresholds such as t = 1 call the two emails with 1 link spam, adding errors, and larger ones miss more spam.
- The smallest number of errors is 1, at t = 2.
Result: The learned rule is "spam if links >= 2", with 1 training error out of 8.
links = [0, 1, 1, 2, 3, 5, 6, 8]
spam = [0, 0, 0, 1, 0, 1, 1, 1]
best = None
for t in range(0, 10):
pred = [1 if x >= t else 0 for x in links]
errors = sum(p != y for p, y in zip(pred, spam))
if best is None or errors < best[1]:
best = (t, errors)
print("Best threshold:", best[0], "Errors:", best[1])
Output
Best threshold: 2 Errors: 1
Common mistakes
- Thinking machine learning means the computer thinks like a human.
- Using machine learning when a few simple rules would solve the problem exactly.
- Forgetting that a model is only as good as the data it learned from.
- Confusing the model (the learned rules) with the algorithm (the learning procedure).
Key takeaways
- Mitchell: learning means performance P at task T improves with experience E.
- Machine learning takes data and answers and produces rules.
- Key milestones: perceptron 1957, decision trees 1986, SVM 1995, deep learning 2012.
- Use ML when rules are complex, changing or unknown.
Practice questions
- State Mitchell's definition of learning.
- What are the inputs and output of a learning algorithm?
- Name two applications of machine learning.
Answers to the practice questions
- A program learns from experience E for task T and measure P if its performance at T, measured by P, improves with E.
- Inputs are data and answers; the output is a model (the rules).
- Spam filtering and product recommendation (also fraud detection, translation).
Sources
- Official BCA syllabus Introduction to Machine Learning, course code 26BCA404DSE21, Unit I
