Docsity

Machine Learning (ML) Exam Guide | PYQs & Algorithm Derivations, Summaries of Machine Learning

Toggle sidebar
bg1
ML — Complete Exam Notes
MACHINE LEARNING
Complete Exam Notes
B.Tech — Computer Science / IT / AI & DS
Standard University Curriculum Edition • 2026–27
Concepts • Solved Examples • High-Priority Topics • Revision
NOTE ON SOURCE BASIS: built on the standard 5-unit ML syllabus taught across Indian engineering universities
(Foundations → Regression → Classification → Unsupervised Learning → Neural Networks). Not copied from any
single university's official document — cross-check against your own handout.
Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Machine Learning (ML) Exam Guide | PYQs & Algorithm Derivations and more Summaries Machine Learning in PDF only on Docsity!

MACHINE LEARNING

Complete Exam Notes

B.Tech — Computer Science / IT / AI & DS

Standard University Curriculum Edition • 2026–

Concepts • Solved Examples • High-Priority Topics • Revision NOTE ON SOURCE BASIS: built on the standard 5-unit ML syllabus taught across Indian engineering universities (Foundations → Regression → Classification → Unsupervised Learning → Neural Networks). Not copied from any single university's official document — cross-check against your own handout.

How To Use These Notes Same sequence as your other guides: first reading, then concept revision, then high- priority topics, then practice, then the cheat sheet alone on the last day. Syllabus Map Uni t Topics Difficulty Priority I Foundations: Types of Learning, Bias- Variance, Overfitting Medium High II Regression: Linear, Polynomial, Logistic Medium Very High III Classification: Decision Trees, k-NN, Naive Bayes, SVM Hard Very High IV Unsupervised Learning: k-Means, Hierarchical, PCA Medium High V Neural Networks: Perceptron, Backpropagation, Ensembles Hard Medium– High

Units II and III carry the heaviest numerical weight — regression coefficient calculations

and decision tree information-gain problems are the most common full-mark questions in

this subject.

Problem What happens Fix Overfitting Model too complex, memorizes training data including noise; performs well on training but poorly on test data Use more training data, add regularization, simplify the model, use cross-validation Section 4 — Bias-Variance Tradeoff Fig 1.1 — Total error is the sum of bias² and variance; both can't be minimized simultaneously beyond a point Definitions: Bias = error from overly simplistic assumptions (leads to underfitting). Variance = error from excessive sensitivity to small fluctuations in training data (leads to overfitting). Exam Tip: 'High bias, low variance' describes underfitting; 'low bias, high variance' describes overfitting — examiners frequently ask you to match a symptom description to one of these two labels, so anchor these pairings precisely rather than the general definitions alone. Section 6 — Important Questions (Unit I)

HIGH PRIORITY

  • Explain the three types of learning with an example task for each.
  • Explain the bias-variance tradeoff with a diagram.
  • Differentiate between overfitting and underfitting, and explain how to fix each.

MEDIUM PRIORITY

  • Why is a separate validation set needed in addition to a test set?
  • Define a well-posed learning problem with an example.

UNIT I — 10-Minute Revision

  • Supervised (labeled) / Unsupervised (unlabeled) / Reinforcement (reward-based)
  • Train → fit parameters; Validation → tune hyperparameters; Test → final unbiased report, used once
  • Underfitting: high bias, low variance | Overfitting: low bias, high variance
  • Total error = Bias² + Variance + irreducible noise

Section 4 — Logistic Regression Why 'regression' but used for classification: Despite the name, logistic regression is a classification algorithm — it uses the sigmoid function to squash the linear output into a probability between 0 and 1. Sigmoid function: σ(z) = 1 / (1 + e⁻ᶻ), where z = w₀ + w₁x₁ + ... + wₙxₙ Decision rule: Predict class 1 if σ(z) ≥ 0.5, else class 0 (threshold is adjustable based on the application). Cost function: Uses log loss (cross-entropy), not MSE — MSE makes the cost function non-convex for logistic regression, so log loss is used specifically because it keeps the optimization problem convex and gradient descent reliable. Exam Tip: 'Why not use MSE for logistic regression' is a specific, frequently tested conceptual question — the convexity reasoning above is exactly the expected answer, not just 'because it works better.' Section 6 — Important Questions (Unit II)

HIGH PRIORITY

  • Derive/explain the gradient descent update rule for linear regression.
  • Explain logistic regression, including the sigmoid function and why log loss is used instead of MSE.
  • Given a small dataset, compute regression coefficients or predictions.

MEDIUM PRIORITY

  • Differentiate MSE, RMSE, MAE, and R² as evaluation metrics.
  • When would you use polynomial regression instead of linear regression? UNIT II — 10-Minute Revision
    • Linear regression: ŷ = w₀ + w₁x, minimized via gradient descent on MSE
    • Learning rate too large → overshoots/diverges; too small → slow convergence
    • R² closer to 1 = better fit; RMSE is in the same unit as the target
    • Logistic regression: sigmoid squashes output to a probability, uses log loss (convex, unlike MSE here)

UNIT III: Classification

What you'll learn

  • Decision trees and how splits are chosen using entropy/information gain
  • k-Nearest Neighbors (k-NN) and the role of k
  • Naive Bayes classification and the independence assumption
  • Support Vector Machines (SVM) and the margin concept
  • How to read a confusion matrix and compute classification metrics Section 1 — Decision Trees Fig 2.1 — Each internal node tests a feature; leaves hold the final class prediction Entropy: H(S) = −Σ pᵢ log₂(pᵢ), where pᵢ is the proportion of each class in set S — measures impurity/disorder; 0 means perfectly pure (all one class). Information Gain: IG(S, A) = H(S) − Σ (|Sᵥ|/|S|) × H(Sᵥ) for each value v of feature A — the reduction in entropy achieved by splitting on feature A. Rule: At each node, the decision tree algorithm (e.g., ID3) picks the feature with the highest information gain to split on. Exam Tip: Numerical entropy/information gain calculations are one of the most common ML exam questions — always compute the parent entropy first, then each child's entropy, then combine using the weighted average before subtracting. Section 2 — k-Nearest Neighbors (k-NN) How it works: To classify a new point, find the k closest training points (typically by Euclidean distance) and assign the majority class among them — no explicit training phase, all computation happens at prediction time (a 'lazy learner'). Effect of k: Small k → sensitive to noise, can overfit (high variance). Large k → smoother decision boundary, can underfit (high bias) and may include points from other classes. Exam Tip: This is another direct bias-variance illustration — connecting k-NN's k parameter to Unit I's bias-variance tradeoff strengthens theory answers noticeably.

Section 6 — Important Questions (Unit III)

HIGH PRIORITY

  • Calculate entropy and information gain for a given dataset, and construct the resulting decision tree split.
  • Explain k-NN and how the choice of k affects bias and variance.
  • Explain Naive Bayes with the independence assumption and a worked probability example.
  • Given a confusion matrix, calculate accuracy, precision, recall, and F1-score.

MEDIUM PRIORITY

  • Explain the maximum margin concept in SVM.
  • What is the kernel trick and why is it useful? UNIT III — 10-Minute Revision
    • Entropy H(S) = −Σ pᵢ log₂(pᵢ); Information Gain = parent entropy − weighted child entropy
    • k-NN: small k = high variance/overfit; large k = high bias/underfit
    • Naive Bayes assumes conditional independence — works well anyway, especially for text
    • SVM maximizes margin; kernel trick handles non-linearly-separable data
    • Accuracy misleads on imbalanced data — use precision/recall/F1 instead

UNIT IV: Unsupervised Learning

What you'll learn

  • k-Means clustering — the algorithm and its limitations
  • Hierarchical clustering and dendrograms
  • Dimensionality reduction using PCA Section 1 — k-Means Clustering Fig 4.1 — Points are grouped around the nearest of k centroids, which are then recomputed and the process repeats

Algorithm steps

    1. Choose k (number of clusters) and randomly initialize k centroids
    1. Assign each data point to its nearest centroid
    1. Recompute each centroid as the mean of all points assigned to it
    1. Repeat steps 2-3 until centroids stop changing (convergence) Limitations: Must specify k in advance; sensitive to initial centroid placement (can converge to a local optimum); assumes roughly spherical, similarly-sized clusters; sensitive to outliers. Choosing k — the Elbow Method: Plot within-cluster sum of squares (WCSS) against different values of k; the 'elbow' point where the rate of decrease sharply flattens is typically chosen as a good k. Exam Tip: Tracing k-means by hand for 1-2 iterations on a small set of 2D points is a common numerical question — always show centroid recalculation explicitly at each step, not just the final clusters. Section 2 — Hierarchical Clustering Definition: Builds a hierarchy of clusters either by merging smaller clusters into larger ones (agglomerative, bottom-up — the more common approach) or splitting large clusters into smaller ones (divisive, top-down).

UNIT IV — 10-Minute Revision

  • k-Means: choose k → assign to nearest centroid → recompute centroid → repeat
  • Elbow Method plots WCSS vs k to choose a good k
  • Hierarchical clustering doesn't need k upfront — cut the dendrogram at any height
  • Linkage: single (closest pair), complete (farthest pair), average (mean distance)
  • PCA: projects onto top eigenvectors of the covariance matrix, ranked by eigenvalue = variance captured

UNIT V: Neural Networks & Ensemble Methods

What you'll learn

  • The perceptron model and its limitations
  • Multi-layer networks and the backpropagation algorithm
  • Common activation functions and why non-linearity matters
  • Ensemble methods: bagging, boosting, and random forests Section 1 — The Perceptron Fig 5.1 — Inputs are multiplied by weights, summed with a bias, then passed through an activation function Model: output = f(Σ wᵢxᵢ + b), where f is an activation function Limitation: A single perceptron can only learn linearly separable functions — famously, it cannot represent XOR. This limitation is exactly why multi-layer networks (with hidden layers) were developed. Exam Tip: 'Why can't a single perceptron solve XOR' is one of the most classic theory questions in this unit — the answer is that XOR is not linearly separable, so no single straight-line decision boundary can separate its classes, which a single perceptron is limited to producing. Section 2 — Activation Functions Function Formula Note Sigmoid 1 / (1 + e⁻ˣ) Output in (0,1); suffers from vanishing gradient for large |x| Tanh (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ) Output in (−1,1); zero-centered, still has vanishing gradient issue ReLU max(0, x) Fast to compute, avoids vanishing gradient for x>0; most common in modern networks

MEDIUM PRIORITY

  • Compare sigmoid, tanh, and ReLU activation functions.
  • Explain how Random Forest differs from plain bagging of decision trees. UNIT V — 10-Minute Revision
    • Perceptron: output = f(Σwx + b) — cannot solve XOR (not linearly separable)
    • ReLU = max(0,x), most common in modern networks; avoids vanishing gradient for x>
    • Backprop: forward pass → compute loss → backward pass (chain rule) → update weights
    • Bagging reduces variance (Random Forest); Boosting reduces bias (AdaBoost)

High-Priority Study Topics — Full Subject

No previous-year paper was supplied for this edition — nothing here is a guaranteed

question. Flagged by how central each topic is to ML courses generally. Replace with your

own PYQ analysis once you have it.

Topic Unit Why it's high-priority Entropy / Information Gain (decision trees) III Most common numerical question in the subject Bias-variance tradeoff I Foundational, reused as reasoning in later units — very common Logistic regression + sigmoid II Standard full-length theory + numerical question k-Means clustering trace IV Common numerical/algorithmic question Confusion matrix metrics III Near-guaranteed numerical question Bagging vs Boosting V Common short-answer distinguishing question

Formula Sheet

  • Linear regression: ŷ = w₀ + w₁x, cost J(w) = (1/2m)Σ(ŷ−y)²
  • Sigmoid: σ(z) = 1/(1+e⁻ᶻ)
  • Entropy: H(S) = −Σ pᵢ log₂(pᵢ)
  • Information Gain: IG = H(parent) − Σ(|Sᵥ|/|S|)H(Sᵥ)
  • Precision: TP/(TP+FP) | Recall: TP/(TP+FN)
  • F1-Score: 2×(Precision×Recall)/(Precision+Recall)

Rapid-Fire Quiz (20 Questions) Attempt without looking back. Answers on the next page.

  1. MCQ: Which learning type uses labeled data? (a) Unsupervised (b) Supervised (c) Reinforcement (d) None
  2. What is the test set used for, and when?
  3. High bias, low variance describes which problem?
  4. MCQ: Which metric is most misleading on imbalanced datasets? (a) Precision (b) Recall (c) Accuracy (d) F
  5. What does the learning rate control in gradient descent?
  6. Why is log loss used instead of MSE in logistic regression?
  7. What does entropy of 0 indicate about a dataset?
  8. MCQ: Small k in k-NN leads to (a) high bias (b) high variance (c) no effect (d) always better accuracy
  9. What assumption does Naive Bayes make about features?
  10. What does SVM try to maximize?
  11. What is the kernel trick used for?
  12. Name the four k-means algorithm steps in order.
  13. What does an eigenvalue represent in PCA?
  14. MCQ: Which activation function is most common in modern deep networks? (a) Sigmoid (b) Tanh (c) ReLU (d) Step
  15. Why can't a single perceptron solve XOR?
  16. What does backpropagation use to compute weight gradients?
  17. Bagging reduces which of bias/variance? Boosting reduces which?
  18. What is Random Forest's key difference from plain bagged decision trees?
  19. What is the Elbow Method used to choose?
  20. State the formula for F1-score.