IAE Academy

GATE DA

Dimensionality reduction and principal component analysis

Dimensionality reduction replaces many correlated features by a few new ones that keep as much of the data's variance as possible. Principal component analysis does this with the eigenvectors and eigenvalues of the covariance matrix, or equivalently the SVD of the centred data. GATE DA questions ask you to compute eigenvalues, the proportion of variance explained, a projected coordinate or a reconstruction error, or to judge what PCA can and cannot do.

2 previous-year questions · 2 solved · 5 practice questions

Why reduce the dimension

A data set with features lives in . When many features are correlated or nearly constant, the points really occupy a much smaller region of that space. Dimensionality reduction maps each point to numbers while losing as little information as possible.

Reasons to reduce

  1. Fewer features mean fewer parameters, so models tend to overfit less when samples are few compared with .

  2. Distances become less informative in very high dimensions; with fewer dimensions, nearest-neighbour and clustering methods can behave better.

  3. Storage and computation fall.

  4. Two or three components can be plotted, which helps to see structure.

  5. With PCA, correlated features are replaced by uncorrelated ones.

Convention used here. Samples are the rows of the data matrix , so is row . Vectors are bold and are column vectors. Distances are Euclidean. Principal directions are taken as unit vectors, and eigenvalues are listed in decreasing order. The sample covariance uses the divisor unless stated otherwise.

Feature selection keeps a subset of the original features. Feature extraction builds new features from all of them. PCA is feature extraction. It is unsupervised and linear: it never looks at labels, and each new feature is a linear combination of the centred original features.

Centring and scaling the data

PCA looks for directions of maximum variance about the mean, so the data must be centred first. Without centring, and when the mean is far from the origin compared with the spread, the first direction mostly points from the origin to the data cloud rather than along its spread.

SAMPLE MEAN AND CENTRED DATA

Centre each feature (column) to mean zero. denotes the centred matrix, whose rows are .

SAMPLE COVARIANCE MATRIX

Symmetric and positive semi-definite. Diagonal entries are feature variances; off-diagonal entries are covariances. Some texts divide by instead. The eigenvectors and the proportions of variance do not change; every eigenvalue is scaled by the same factor.

When to standardise. Variance depends on units. If one feature is measured in thousands and another in fractions, the first dominates the variance and PCA simply returns it. When features have different units or very different scales, divide each centred column by its standard deviation (a z-score) before PCA. If the standard deviation uses the same divisor as the covariance (here ), becomes the correlation matrix . has 1 on every diagonal entry, so the total variance equals . When all features share the same units and the scale itself carries meaning, centring alone is usually used.

EXAM TIP

Changing the scale of one feature generally changes the principal directions of the covariance matrix, so PCA on and PCA on generally give different components. The exception is uncorrelated features: then is diagonal and the directions stay the coordinate axes (only their order can change).

Principal components from the covariance matrix

The first principal direction is the unit vector that maximises the variance of the projections . For a unit vector , the variance of the projections is . Maximise subject to with a Lagrange multiplier. The condition is , so the best is an eigenvector and the variance it reaches is its eigenvalue. The second direction maximises variance among unit vectors orthogonal to the first, and so on.

PRINCIPAL DIRECTIONS

The eigenvectors of the symmetric matrix are chosen orthonormal. is the -th principal direction (component). A direction is fixed only up to sign.

SPECTRAL DECOMPOSITION AND COVARIANCE OF SCORES

is orthogonal and . The scores (defined below) have the diagonal covariance .

VARIANCE ALONG A PRINCIPAL DIRECTION

Projections onto different components are uncorrelated: for .

VARIANCE ALONG ANY UNIT DIRECTION

The largest possible projected variance is , reached at . The smallest is , reached at .

TOTAL VARIANCE

Total variance is unchanged by rotating to the principal axes. For standardised data it equals .

PROPORTION OF VARIANCE EXPLAINED

Choose the smallest whose cumulative proportion reaches a stated target, such as 90 percent.

Choosing k

  1. Variance target: the smallest with at or above the target. This is how a question usually fixes .

  2. Scree plot (rule of thumb): plot against and keep the components before the curve flattens (the elbow).

  3. Eigenvalue above 1 (rule of thumb, correlation matrix only): keep components with , that is, above the average eigenvalue .

PROJECTION (SCORES) ONTO $K$ COMPONENTS

has orthonormal columns. The coordinate along is .

RECONSTRUCTION AND ERROR

The are eigenvalues of with divisor . With divisor , the mean squared error equals the sum of the discarded eigenvalues exactly. Among all -dimensional affine subspaces (all rank- linear reconstructions of the centred data), projecting onto the top components gives the smallest total squared reconstruction error. Maximising the retained variance and minimising the reconstruction error lead to the same components.

EXAM TIP

For a covariance matrix, the eigenvalues satisfy and . This is usually faster than expanding the characteristic polynomial.

EXAM TIP

Adding a constant to any feature changes nothing, because centring removes it. Multiplying every feature by the same multiplies every eigenvalue by and leaves the principal directions and the proportions of variance unchanged. Rescaling only some features generally changes the directions.

PCA through the singular value decomposition

You can get the components without forming , from the SVD of the centred data matrix. Substitute into to get . This is an eigendecomposition, and its eigenvectors are the columns of .

SVD OF THE CENTRED DATA

The columns of (right singular vectors) are the principal directions. The are the singular values in decreasing order. The are eigenvalues of with divisor .

SCORES FROM THE SVD

This uses the first columns of and and the top-left block of . The best rank- approximation of is .

GRAM-MATRIX ROUTE (USEFUL WHEN D > N)

The matrix has the same non-zero eigenvalues as . When it is the smaller matrix to decompose.

EXAM TIP

Apply the SVD to the centred matrix. The SVD of the uncentred gives different directions. The columns of are not the principal directions: they have one entry per sample, and is the vector of scores on component scaled to unit length.

Procedure and worked examples

PCA procedure

  1. Arrange samples in rows. Centre each column, and divide it by its standard deviation if the features differ in scale.

  2. Form , or take the SVD of .

  3. Find the eigenvalues in decreasing order and their orthonormal eigenvectors.

  4. Compute the cumulative proportion of variance and choose .

  5. Project: . To reconstruct, use .

WORKED EXAMPLE

A centred data set has sample covariance matrix . Find (a) the eigenvalues, (b) the first principal direction (the unit vector with positive components), (c) the proportion of variance explained by the first component, (d) the coordinate along it of the centred point , and (e) that point's reconstruction from the first component alone, with its squared reconstruction error.

Solution
  1. and , so , which gives and .

  2. For : , so . Normalising gives . Check: .

  3. Proportion of variance: .

  4. Coordinate of along : .

  5. Reconstruction (the data are centred, so ): . The error vector is , so the squared error is .

  6. Check: the second direction is . The point's coordinate along it is , and its square, 5, equals the squared error.

Answer: ; ; 6/7 of the variance; coordinate ; reconstruction with squared error 5.

WORKED EXAMPLE

The centred data matrix has the four rows , , , . Find the singular values, the eigenvalues of the sample covariance matrix (divisor ), and the proportion of variance explained by the first component.

Solution
  1. Each column sums to zero, so the data are centred. .

  2. Its eigenvalues are 8 and 2, so the singular values are and . The first principal direction is .

  3. With : and .

  4. Proportion: .

Answer: ; ; the first component explains 80 percent.

What PCA cannot do

Limitation

Why it happens

Misses non-linear structure

Components are linear combinations; data on a curve or a circle needs a non-linear method to be unrolled.

Ignores class labels

High variance need not mean useful for classification: the direction that separates two classes can be a low-variance direction that PCA discards.

Sensitive to scale

Directions generally change when some features are rescaled, so standardise when units differ.

Sensitive to outliers

A few extreme points inflate variance and can swing the first direction.

Components are hard to interpret

Each is usually a mix of all the original features, so the new features have no direct physical meaning.

Uses only second-order statistics

Uncorrelated components are not necessarily independent unless the data are jointly Gaussian.

Sign is arbitrary, repeated eigenvalues are not unique

and are equally valid; if , any orthonormal basis of that eigenspace works.

EXAM TIP

Keeping all components loses nothing, because it only rotates the centred data. Information is lost only when . The reconstruction error is proportional to the sum of the discarded eigenvalues. As a fraction of the total squared distance of the points from their mean, it equals .

EXAM TIP

The rank of is at most , so with samples at most eigenvalues are non-zero. A zero eigenvalue means the data lie exactly in a lower-dimensional flat (an affine subspace).

PREVIOUS-YEAR QUESTIONS

2 questions from the DA papers

Try each question first, then open the answer. We placed each question under a topic ourselves; the exam paper does not label topics.

See these papers in full: GATE DA 2026 · GATE DA 2025

GATE 2026 DA Q.11

GATE 2026 · DAQ.11 · 1 mark · MCQ

For a classification problem, Principal Component Analysis (PCA) has been used to reduce the dimensionality of a feature space from 100 to 10.

Which of the following options is true about the angle between the first and the tenth principal components?

  1. (A)

  2. (B)

  3. (C)

  4. (D)

Answer and solution
See the question in the paper
GATE 2026 DA Q.11: answer and solution

GATE 2025 DA Q.60

GATE 2025 · DAQ.60 · 2 marks · NAT

Let be a dataset of observations where each . It is given that . The covariance matrix computed from has eigenvalues , . Let be the direction of maximum variance with .

The value of ______

(Answer in integer)

Answer and solution
See the question in the paper
GATE 2025 DA Q.60: answer and solution

PRACTICE

5 questions to test yourself

PRACTICE 11 mark · NAT

A centred data set has sample covariance matrix . What is the variance of the data projected onto the first principal component?

Answer and solution

Answer: (accepted range )

  1. and , so .

  2. The eigenvalues are 4 and 2.

  3. The variance along the first principal component is the largest eigenvalue, 4.

PRACTICE 22 marks · MSQ

The data matrix (samples in rows) is centred and has the SVD with singular values . The sample covariance uses divisor . Which of the following are correct?

  1. (A)

    The columns of are the principal directions.

  2. (B)

    For each non-zero singular value, is an eigenvalue of the sample covariance matrix.

  3. (C)

    The matrix of scores on all components is .

  4. (D)

    The columns of are the principal directions.

Answer and solution

Answer: (A), (B), (C)

  1. , so the columns of are the eigenvectors of the covariance matrix. A is true.

  2. Dividing by gives the eigenvalues . B is true.

  3. . C is true.

  4. The columns of have one entry per sample; they are normalised score vectors, not directions in feature space. D is false.

PRACTICE 32 marks · NAT

Three points in the plane are , and . After centring, the first principal direction is the unit vector with positive components. What is the coordinate of the point along (its first principal component score)? Give the answer correct to two decimal places.

Answer and solution

Answer: (accepted range )

  1. The mean is . The centred points are , and .

  2. , so with divisor , . Its eigenvalues are 8 and 0, and the eigenvector for 8 is . All the points lie on the line .

  3. The centred point for is , and its score is .

PRACTICE 42 marks · MCQ

PCA is applied to four standardised features, so the covariance matrix is the correlation matrix. Its eigenvalues are 2.4, 1.0, 0.4 and 0.2. What is the smallest number of components that retains at least 90 percent of the total variance?

  1. (A)

    1

  2. (B)

    2

  3. (C)

    3

  4. (D)

    4

Answer and solution

Answer: (C)

  1. The total variance is , which equals the number of standardised features.

  2. One component keeps percent.

  3. Two components keep percent, which is below 90 percent.

  4. Three components keep percent, which is at least 90 percent, so .

PRACTICE 51 mark · MCQ

Which statement about principal component analysis (PCA) on a centred data matrix is correct?

  1. (A)

    The first principal component is the direction along which the projected data have the smallest variance.

  2. (B)

    The principal directions are eigenvectors of the sample covariance matrix and are mutually orthogonal.

  3. (C)

    PCA requires the class labels of the samples to find the components.

  4. (D)

    Multiplying one feature by 10 never changes the principal directions of the covariance matrix.

Answer and solution

Answer: (B)

  1. A is false: the first component maximises the projected variance; it does not minimise it.

  2. B is true: the covariance matrix is symmetric, so its eigenvectors can be chosen orthonormal, and these are the principal directions.

  3. C is false: PCA is unsupervised.

  4. D is false: rescaling one feature changes the covariance matrix and generally rotates the directions (they stay put only in special cases, such as uncorrelated features).

OFFICIAL GATE 2027 SYLLABUS WORDING

Copied from the GATE 2027 syllabus; see all 2027 syllabi.

GATE DA

dimensionality reduction, principal component analysis

Preparing in Kolkata? IAE Academy's course for GATE DA.