What Is Machine Learning?
Machine learning (ML) is a branch of artificial intelligence concerned with building algorithms that improve their performance on a task by learning statistical patterns from data, instead of relying on rules that a programmer writes explicitly. Tom Mitchell's classic 1997 definition frames it precisely: a computer program is said to learn from experience E with respect to some task T and performance measure P, if its performance at T, as measured by P, improves with experience E. In practice this means we give an algorithm many examples (experience), it produces a model that captures regularities in those examples, and we evaluate whether that model gets better at the task as more or better data is provided.
Cricket analogy: A young bowler improves not because a coach writes explicit rules for every batter, but because after facing thousands of deliveries (experience), his economy rate (performance measure) on containing batters (the task) steadily gets better with more match exposure.
Why Learning Beats Hand-Coded Rules
Some problems are too complex, too variable, or too poorly understood to reduce to a finite set of if-else rules. Recognizing handwritten digits, filtering spam email, or predicting which customers will churn all involve subtle, high-dimensional patterns that shift over time and vary across populations. Writing rules by hand for every case is brittle and does not generalize to inputs the programmer never anticipated. A learning algorithm instead searches for a function that fits the observed examples well and, if trained properly, generalizes to new, unseen examples drawn from the same underlying distribution.
Cricket analogy: No fixed rulebook can cover every bowling variation a batter might face across different pitches and conditions; a good player instead develops instinct from countless deliveries that generalizes to a bowler's action never encountered before.
The Core Ingredients
Every ML system needs three things: data that represents the problem (examples of inputs and, for supervised tasks, the correct outputs), a model with adjustable parameters that can represent a family of possible functions, and an optimization procedure that adjusts those parameters to reduce error on the training data. A loss function quantifies how wrong the model's predictions are, and a training algorithm such as gradient descent nudges the parameters to reduce that loss iteratively.
Cricket analogy: A team needs match footage of past games (data), a set of tactics that can be adjusted like field settings and batting order (model with parameters), and post-match review sessions that tweak those tactics to reduce losses (optimization) — with the scoreline itself as the loss function guiding every adjustment.
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
# Load a real dataset: predict whether a tumor is malignant or benign
data = load_breast_cancer()
X_train, X_test, y_train, y_test = train_test_split(
data.data, data.target, test_size=0.2, random_state=42
)
# The model 'learns' decision boundaries from labeled examples
model = LogisticRegression(max_iter=5000)
model.fit(X_train, y_train)
print(f"Learned accuracy on unseen data: {model.score(X_test, y_test):.3f}")
# No cancer-diagnosis rules were hand-coded -- the model discovered
# a decision boundary directly from 30 measured features per sample.A useful mental model: traditional programming is 'rules + data -> answers', while machine learning is 'data + answers -> rules'. The learning algorithm's job is to infer the rules (the model) that would have produced the observed answers.
A common misconception is that ML models 'understand' the task the way a human does. In reality, most models are pattern-matching statistical functions with no semantic grounding — they can fail unpredictably on inputs that differ from their training distribution, even when the failure seems obvious to a human.
- Machine learning builds systems that improve at a task through experience (data), rather than through explicitly programmed rules.
- Mitchell's definition ties learning to a measurable performance improvement on a specific task as experience accumulates.
- The three core ingredients are data, a parameterized model, and an optimization procedure guided by a loss function.
- ML is most valuable when rules are too complex, too numerous, or too unknown to hand-code directly.
- Learned models are statistical approximations, not semantic understanding, and can fail outside their training distribution.
- Generalization to new, unseen data — not just fitting training examples — is the real measure of a successful model.
Practice what you learned
1. According to Tom Mitchell's definition, a program is 'learning' when:
2. What is the main practical advantage of ML over hand-coded rules for tasks like spam filtering?
3. In the code example using LogisticRegression on the breast cancer dataset, what plays the role of 'experience' in Mitchell's definition?
4. Which statement best describes the relationship between a loss function and training?
5. Why is the warning about ML 'understanding' important?
Was this page helpful?
You May Also Like
Types of Machine Learning
A survey of the major machine learning paradigms — supervised, unsupervised, semi-supervised, and reinforcement learning — and the kinds of problems each is designed to solve.
ML vs Traditional Programming
A conceptual comparison of machine learning and traditional rule-based programming, focused on how each approach turns inputs into outputs and when each is the right tool.
The Machine Learning Workflow
An end-to-end walkthrough of the standard machine learning project lifecycle, from problem framing and data collection through model deployment and monitoring.
Datasets, Features, and Labels
Explains the vocabulary and structure of ML data — datasets, samples, features, and labels — and how they are organized before a model can be trained.