Back to the 2023 paper

Module 3: Classification Algorithms

20237m

Discuss with examples of instance-based learning algorithms.

Worked SolutionAI Assisted

Instance-Based Learning (Lazy Learning): Stores training instances, delays generalization until query. Prediction via similarity to stored instances, not explicit model.

General steps: Store D={(xi,yi)}D=\{(x_i,y_i)\}; for query xqx_q, find kk nearest neighbors by distance (Euclidean/Manhattan/cosine), combine (majority vote / weighted average / local regression).

Examples:

  1. k-Nearest Neighbors (k-NN):

    • Classification: y^=arg⁡max⁡c∑xi∈Nk(xq)I(yi=c)\hat y = \arg\max_c \sum_{x_i\in N_k(x_q)} \mathbb{I}(y_i=c) (optionally distance-weighted: wi=1/d(xq,xi)2w_i=1/d(x_q,x_i)^2)
    • Regression: y^=1k∑yi\hat y = \frac1k\sum y_i
    • Choose kk via CV; small kk flexible but noisy, large kk smooth but underfits. Need feature scaling, handles multi-modal, no training time, slow query O(nd)O(n d), needs KD-tree/ball-tree for speed. Pros: simple, effective with many data. Cons: curse of dimensionality, sensitive to irrelevant features.
  2. Locally Weighted Regression (LWR):

    • Fits local model (e.g., linear) weighted by kernel wi=exp⁡(−d(xq,xi)2/2τ2)w_i=\exp(-d(x_q,x_i)^2/2\tau^2). Prediction f^(xq)=xqTβq \hat f(x_q)=x_q^T\beta_q where βq=(XTWX)−1XTWy\beta_q=(X^T W X)^{-1}X^T W y.
    • Example: LOESS for smoothing.
  3. Case-Based Reasoning (CBR): Solves new problems by adapting solutions from similar past cases (e.g., medical diagnosis: retrieve similar patient cases, adapt treatment). Retrieve-Reuse-Revise-Retain cycle.

  4. Radial Basis Function (RBF) Network (kernel memory based): Some interpretations include it.

Characteristics: No explicit training, incremental easily, ability to model complex boundaries locally, but memory intensive, needs careful distance metric selection and feature weighting.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.