Machine Learning Fundamentals

GATE Relevance: High

🎯 Learning Objectives

  • Understand what Machine Learning is and why it matters
  • Know Tom Mitchell’s formal definition of ML
  • Distinguish between supervised, unsupervised, semi-supervised, and reinforcement learning
  • Describe the complete ML pipeline from data collection to deployment
  • Master key terminology: features, labels, hypothesis, loss functions, data splits

1. What is Machine Learning?

Machine Learning (ML) is a subfield of Artificial Intelligence that gives computers the ability to learn from data without being explicitly programmed for every possible scenario. Instead of writing rules by hand, we provide the machine with data and let it discover patterns automatically.

Definition — Arthur Samuel (1959)

“Machine Learning is the field of study that gives computers the ability to learn without being explicitly programmed.”

Consider a spam email filter. A traditional programming approach would enumerate explicit rules (“if subject contains ‘free money’, mark as spam”). An ML approach feeds thousands of labelled emails to an algorithm, which automatically discovers the patterns distinguishing spam from legitimate mail.

Why ML Matters for GATE DA

GATE DA (Data Science & AI) places significant weight on ML foundations. Questions range from conceptual MCQs about learning paradigms to numerical problems requiring you to compute loss functions, gradients, or evaluation metrics by hand.

2. Tom Mitchell’s Formal Definition

Tom Mitchell’s Definition (1997)

A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.

This definition is precise and frequently tested in GATE. Let us break it down with examples:

Example — Email Spam Classification
  • Task (T): Classify emails as spam or not-spam
  • Experience (E): A dataset of emails labelled as spam or not-spam
  • Performance (P): Percentage of emails correctly classified (accuracy)

The system “learns” if its accuracy improves as it processes more labelled emails.

Example — House Price Prediction
  • Task (T): Predict the selling price of a house
  • Experience (E): Historical data of house features and prices
  • Performance (P): Mean Squared Error between predicted and actual prices
GATE Trap

Questions may ask you to identify T, E, and P for a given scenario. Be careful: the “experience” is always the data the system learns from, not the act of running the algorithm.

3. Types of Machine Learning

ML algorithms are categorised based on the nature of the training signal (feedback) available to the learner.

3.1 Supervised Learning

The training data consists of input-output pairs (x, y). The algorithm learns a mapping function f: X → Y from inputs to outputs. The “supervisor” provides the correct label for each training example.

  • Classification: Output y is a discrete category (e.g., spam/not-spam, digit 0–9)
  • Regression: Output y is a continuous value (e.g., house price, temperature)

Examples: Linear Regression, Logistic Regression, Decision Trees, SVMs, Neural Networks, KNN, Naive Bayes.

3.2 Unsupervised Learning

The training data has no labels — only inputs x. The algorithm must discover hidden structure or patterns in the data on its own.

  • Clustering: Group similar data points (e.g., K-Means, DBSCAN, Hierarchical)
  • Dimensionality Reduction: Reduce the number of features while preserving information (e.g., PCA)
  • Association Rules: Discover relationships between variables (e.g., Apriori)
  • Density Estimation: Model the underlying probability distribution of the data

3.3 Semi-Supervised Learning

A small amount of labelled data is combined with a large amount of unlabelled data. This is practical because labelling data is expensive. The unlabelled data helps the model understand the data distribution, while the labelled data provides the supervision signal.

Use case: Medical imaging where labelling requires expert radiologists (expensive), but unlabelled scans are abundant.

3.4 Reinforcement Learning

An agent learns by interacting with an environment. Instead of being told the correct answer, the agent receives rewards or penalties for its actions. The goal is to learn a policy that maximises cumulative reward over time.

  • Key concepts: State, Action, Reward, Policy, Value Function
  • Examples: Game playing (AlphaGo), robotic control, recommendation systems
AspectSupervisedUnsupervisedSemi-SupervisedReinforcement
LabelsAll data labelledNo labelsFew labels + many unlabelledReward signal
GoalPredict outputFind structurePredict with limited labelsMaximise reward
FeedbackDirect (correct answer)NonePartialDelayed (reward)
ExamplesClassification, regressionClustering, PCALabel propagationQ-learning, SARSA

4. The Machine Learning Pipeline

Building an ML system involves a systematic pipeline of steps. Understanding this pipeline is essential for both practical ML and GATE conceptual questions.

1

Data Collection

Gather raw data from various sources: databases, APIs, sensors, web scraping, surveys. The quality and quantity of data directly impacts model performance. Garbage in, garbage out is a fundamental ML principle.

2

Data Preprocessing

Clean and prepare the data: handle missing values, remove duplicates, fix inconsistencies, encode categorical variables, normalise/standardise numerical features. This step typically consumes 60–80% of an ML project’s time.

3

Feature Engineering & Selection

Create new informative features from raw data (feature engineering) and select the most relevant features (feature selection). Good features can dramatically improve model performance.

4

Data Splitting

Split the dataset into training set (60–80%), validation set (10–20%), and test set (10–20%). The training set is used to fit the model, the validation set to tune hyperparameters, and the test set for final unbiased evaluation.

5

Model Selection

Choose an appropriate algorithm based on the problem type (classification/regression), data characteristics (size, dimensionality, linearity), and requirements (interpretability, speed).

6

Model Training

Fit the model to the training data by optimising the loss function. The training algorithm adjusts model parameters to minimise the difference between predictions and actual values.

7

Model Evaluation

Assess model performance on the validation/test set using appropriate metrics (accuracy, precision, recall, F1, MSE, R², etc.). Compare against baselines and alternative models.

8

Hyperparameter Tuning

Adjust hyperparameters (learning rate, regularisation strength, tree depth, etc.) using techniques like grid search, random search, or Bayesian optimisation. Evaluate each configuration on the validation set.

9

Deployment & Monitoring

Deploy the final model to production. Continuously monitor its performance for data drift (changes in input distribution) and concept drift (changes in the underlying relationship). Retrain as needed.

5. Key Terminology

Mastering ML vocabulary is critical for understanding textbooks, research papers, and GATE questions.

Features (Input Variables)

The measurable properties or attributes of the data used as inputs to the model. Also called independent variables, predictors, or attributes. Denoted as x = (x₁, x₂, …, xₙ) where n is the number of features.

Labels (Target Variable)

The output value the model is trying to predict. Also called the dependent variable, response, or target. Denoted as y. In supervised learning, labels are provided during training.

Training Set, Validation Set, Test Set

Training set: Data used to fit/train the model parameters.
Validation set: Data used to tune hyperparameters and select among candidate models. Not used for training.
Test set: Data held out for final, unbiased evaluation. Never seen during training or tuning.

Hypothesis & Hypothesis Space

A hypothesis h(x) is a candidate function that maps inputs to outputs. The hypothesis space H is the set of all possible hypotheses that the learning algorithm considers. For example, in linear regression, H is the set of all linear functions h(x) = w₁x₁ + w₂x₂ + … + wₙxₙ + b.

Loss Function (Cost Function)

A function that quantifies the error between the model’s prediction ŷ and the true label y for a single example. The cost function (or objective function) is typically the average loss over all training examples.

Common loss functions:

  • Mean Squared Error (MSE): L = (1/n) ∑(yᵢ − ŷᵢ)² — for regression
  • Cross-Entropy Loss: L = −(1/n) ∑[yᵢ log(ŷᵢ) + (1−yᵢ) log(1−ŷᵢ)] — for binary classification
  • 0-1 Loss: L = 1 if ŷ ≠ y, else 0 — for classification (not differentiable)
Parameters vs Hyperparameters

Parameters: Internal to the model, learned from data during training (e.g., weights w in linear regression, split thresholds in decision trees).
Hyperparameters: Set before training by the user, not learned from data (e.g., learning rate, number of hidden layers, regularisation strength λ, K in KNN).

Generalisation

The ability of a trained model to perform well on unseen data (not just the training set). A model that performs well on training data but poorly on test data has poor generalisation — this is called overfitting.

6. Parametric vs Non-Parametric Models

AspectParametricNon-Parametric
AssumptionsAssumes a fixed functional form (e.g., linear)No fixed functional form
ParametersFixed number, independent of data sizeGrows with training data size
Training speedGenerally fasterCan be slower for large datasets
Data requirementWorks with less dataNeeds more data to avoid overfitting
FlexibilityLess flexible (may underfit)More flexible (may overfit)
ExamplesLinear/Logistic Regression, Naive Bayes, PerceptronKNN, Decision Trees, SVM with RBF kernel

7. ML vs Traditional Programming

In traditional programming, a human writes explicit rules: Data + Rules → Output. In Machine Learning, the paradigm is inverted: Data + Output → Rules (Model). The algorithm discovers the rules from data automatically.

When to Use ML vs Traditional Programming
  • Use ML when: The rules are too complex to code manually (e.g., image recognition), the rules change frequently (e.g., fraud detection), or you have abundant data but no clear algorithm.
  • Use traditional programming when: The rules are well-known and simple (e.g., tax calculation), the problem is deterministic, or the system must be fully explainable and auditable.

8. GATE-Style Practice

GATE Example 1 (MCQ)

Q: In Tom Mitchell’s definition, a program learns from experience E with respect to task T and performance measure P. For a chess-playing program that improves by playing against itself, identify T, E, and P.

A: T = Playing chess. E = Games played against itself. P = Percentage of games won against opponents.

GATE Example 2 (MCQ)

Q: Which of the following is NOT a type of unsupervised learning?

(A) Clustering   (B) Dimensionality Reduction   (C) Regression   (D) Association Rule Mining

A: (C) Regression is a supervised learning task because it requires labelled training data (continuous target values).

GATE Example 3 (True/False)

Q: In semi-supervised learning, the model uses only labelled data for training.

A: False. Semi-supervised learning uses both a small amount of labelled data and a larger amount of unlabelled data.

9. Chapter Summary

  • ML enables computers to learn patterns from data rather than following explicit rules
  • Mitchell’s definition: A program learns from E (experience) w.r.t. T (task) and P (performance measure)
  • Four paradigms: Supervised (labelled data), Unsupervised (no labels), Semi-supervised (few labels), Reinforcement (rewards)
  • The ML pipeline has 9 stages from data collection to deployment
  • Key distinction: Parameters are learned; hyperparameters are set by the user
  • Generalisation — performing well on unseen data — is the ultimate goal