How unit 4 is examined
This unit covers reducing the number of features by extraction (PCA, LDA) or selection (branch and bound, forward/backward, (l,r)); types of feature extraction and the three search algorithms carry the marks.
Introduction of feature extraction and feature selection
Low weight
Definition. Dimension reduction is the process of mapping a d-dimensional feature vector to m < d features while keeping the information needed to classify well. Feature extraction builds m new features by transforming all d originals; feature selection picks m of the d originals unchanged.
Key points.
- The curse of dimensionality says that as d grows, the data needed to estimate a classifier grows exponentially, so a fixed training set becomes sparse and the classifier overfits.
- Dimension reduction is needed for visualization (plot in 2-D or 3-D), compression (less storage and faster computation) and better classification (noise and redundant features are removed).
- Feature extraction gives new, combined features (PCA, LDA) and the original meaning is lost; feature selection keeps original features, so results stay interpretable.
- Both methods work in three stages: define a criterion $J$ (variance, class separability, error rate), search for the best m features or projection, and then classify in the reduced space.
- Example: 100 pixel intensities of a digit image reduced by PCA to 10 components, or a 20-attribute patient record reduced to the 5 best attributes by selection.
Asked: [7 marks] (Dec 2020) What is dimension reduction? Explain.
Types of feature extraction
Medium weight
Definition. Feature extraction transforms the raw measurements into a smaller set of new, informative features that are less redundant and easier to classify.
Key points.
- Statistical features (mean, variance, moments, histograms) summarise the distribution of the raw values.
- Transform features (Fourier, wavelet, DCT, PCA) express the signal in another basis, where few coefficients carry most of the energy.
- Edge and shape features (gradients, contours, Hough lines) describe boundaries in images.
- Texture features (co-occurrence matrix, Gabor filters) describe the repeating spatial pattern of intensity.
- Linear methods use $y = W^T x$: PCA is unsupervised and keeps maximum variance, while LDA is supervised and keeps maximum class separation.
- Selection criteria for a method: whether labels are available, whether linearity is acceptable, and the class separability retained.
PCA steps.
Step 1: Take n samples x_i in R^d and compute the mean mu = (1/n) sum x_i.
Step 2: Centre the data: x_i' = x_i - mu.
Step 3: Compute the covariance matrix C = (1/n) sum x_i' x_i'^T (d x d).
Step 4: Find eigenvalues and eigenvectors of C; sort by eigenvalue, largest first.
Step 5: Keep the top m eigenvectors as W (d x m); choose m so that sum of top m eigenvalues / sum of all >= 90-95%.
Step 6: Project: y = W^T (x - mu).
LDA. Choose $W$ to maximise $J(W) = \dfrac{|W^T S_B W|}{|W^T S_W W|}$, where $S_B$ is the between-class scatter and $S_W$ the within-class scatter; for c classes it gives at most c-1 features.
PCA limits. It is linear, unsupervised (the high-variance direction need not separate classes), and sensitive to feature scaling; its uses are compression, noise removal and visualization.
Answer frame. For PCA: open with "PCA is a linear, unsupervised method that projects data onto the orthogonal directions of maximum variance"; draw a 2-D scatter with the PC1 axis along the long axis; give steps 1-6, then uses and limits; close with the variance-retained rule. For types: open with the definition; list points 1-4 as a table of type and example, then PCA and LDA (point 5), then selection criteria.
Asked: [7 marks] (Jun 2020) Discuss Principle Component Analysis (PCA) algorithm for dimension reduction. Asked: [7 marks] (Nov 2023) Discuss the various types of feature extraction.
Problem statement and uses
Not asked since 2022
Definition. Given d candidate features, feature selection finds the subset of m features that maximises a criterion $J$.
Key points.
- The number of possible subsets is $\binom{d}{m}$, and $2^d$ over all sizes, so exhaustive search is impractical for large d.
- Uses: fewer measurements, faster and cheaper classifiers, less overfitting, and better accuracy when irrelevant features are dropped.
- The curse of dimensionality (peaking phenomenon) is the reason: beyond some d, accuracy falls with a finite sample.
- The criterion $J$ is a class separability measure, such as Mahalanobis distance or the classifier accuracy.
Algorithms: branch and bound
Low weight
Definition. Branch and bound is an optimal search that finds the best m-feature subset without testing every subset, by pruning branches whose bound cannot beat the best found so far.
Key points.
- It needs a monotonic criterion: for subsets $X \subset Y$, $J(X) \le J(Y)$, so removing features never increases $J$.
- Branching: the root holds all d features and each level discards one feature, giving a tree of depth d-m; discarded indices increase down a path to avoid duplicates.
- Bounding: the best complete m-subset found so far gives a bound B.
- Pruning: if a node has $J \le B$, every descendant has $J \le B$ by monotonicity, so the whole subtree is skipped.
- It is optimal, but worst-case complexity is still exponential; it is far faster in practice.
Example. d = 4, m = 2, $J = 1 - \prod(1-r_i)$ with r = 0.5, 0.3, 0.4, 0.2 for features 1-4; explored right to left.
| Visit | Node | J | Bound B |
|---|---|---|---|
| 1 | Drop 3 then 4: {1,2} | 0.65 | 0.65 |
| 2 | Drop 2 (0.76 > B): leaf {1,4} | 0.60 | 0.65 |
| 3 | Leaf {1,3} | 0.70 | 0.70 |
| 4 | Drop 1: 0.664 <= 0.70, pruned | - | 0.70 |
Answer: best subset {1, 3}, J = 0.70; 3 of 6 leaves evaluated.
Answer frame. Open with the definition and monotonicity; draw the search tree; explain branch, bound, prune in order; work the example table; close with optimality and exponential worst case.
Asked: [7 marks] (Nov 2023) Illustrate branch and bound Algorithm with suitable example.
Sequential forward / backward selection
Low weight
Definition. Sequential forward selection (SFS) starts with an empty set and repeatedly adds the one feature that most improves $J$; sequential backward selection (SBS) starts with all features and repeatedly removes the least useful one.
Key points.
- SFS is a greedy, bottom-up search, and SBS is greedy, top-down.
- At each step SFS evaluates $d - k$ candidates when k features are chosen, so it needs about $md$ evaluations, far fewer than $\binom{d}{m}$.
- Once a feature is added (SFS) or removed (SBS) it is never reconsidered (the nesting problem), so the result may be suboptimal.
- Stopping criteria: the subset reaches size m, or the gain in $J$ falls below a threshold.
Step 1: S = empty set, k = 0.
Step 2: For every feature f not in S, compute J(S + {f}).
Step 3: Add the f with the largest J to S; k = k + 1.
Step 4: If k = m (or gain < threshold) stop; otherwise go to Step 2.
Example. Same J as above, m = 2. Step 1: J(1)=0.5, J(2)=0.3, J(3)=0.4, J(4)=0.2, so add feature 1. Step 2: J(1,2)=0.65, J(1,3)=0.70, J(1,4)=0.60, so add feature 3. Answer: S = {1, 3}, J = 0.70.
Answer frame. Open with the definition of SFS; write the algorithm; show the two-step example; close with stopping criteria and the nesting drawback (SBS is the reverse).
Asked: [7 marks] (Nov 2023) Write an algorithm for forward selection with suitable example.
(l,r) algorithm
Not asked since 2022
Definition. The (l,r) algorithm, also called plus-l take-away-r, adds l features by forward selection and then removes r by backward selection, repeating until m features remain.
Key points.
- If l > r it starts from the empty set and grows; if l < r it starts from the full set and shrinks.
- Because r features can be removed after l are added, it corrects the nesting problem of SFS and SBS.
- It is still greedy, so it is not guaranteed optimal, and it costs more than SFS.
- With l = 1, r = 0 it becomes SFS; with l = 0, r = 1 it becomes SBS.
Last-minute revision
- Dimension reduction maps d features to m < d; extraction transforms, selection picks.
- Curse of dimensionality: data needed grows exponentially with d.
- PCA: centre, covariance, eigen decomposition, keep top m, project $y = W^T(x-\mu)$.
- PCA keeps maximum variance (unsupervised); LDA maximises $|W^TS_BW|/|W^TS_WW|$ (supervised), at most c-1 features.
- Types: statistical, transform, edge/shape, texture.
- Subsets of size m: $\binom{d}{m}$.
- Branch and bound: optimal, needs monotonic J, prunes nodes with $J \le B$.
- Worked example: J(1,3) = 0.70 is best for d=4, m=2.
- SFS adds best feature, SBS removes worst; both greedy with nesting problem.
- (l,r): add l, remove r; l > r starts empty.
Memory hooks
- PCA = "Centre, Covariance, Component, Cut, Convert" (project).
- Extraction makes new features; selection chooses old ones.
- Branch and bound: "bound beats branch" when node J is at most B.
- SFS is Small-to-Full, SBS is Big-to-Small.
- (l,r) = plus l, take away r.
Coverage checklist
- introduction of feature extraction and feature selection: Dec 2020 dimension reduction.
- types of feature extraction: Jun 2020 PCA; Nov 2023 types of feature extraction.
- Problem statement and Uses: no past question.
- Algorithms - Branch and bound algorithm: Nov 2023 branch and bound.
- sequential forward / backward selection algorithms: Nov 2023 forward selection.
- (l,r) algorithm: no past question.