2022 question paper
MACHINE LEARNING
22 questions
Q1a. Which of the following is correct use of cross validation? (i) Selecting variables to include in a model (ii) Comparing predictors (iii) Electing parameters in prediction function (iv) All of the above20222m
Module 1: Introduction
View this question on its own page →Which of the following is correct use of cross validation?
(i) Selecting variables to include in a model
(ii) Comparing predictors
(iii) Electing parameters in prediction function
(iv) All of the aboveWorked SolutionAnswer: (iv) All of the above
Correct uses of Cross Validation (CV):
Cross validation (k-fold, LOOCV, stratified) estimates generalization performance by partitioning data into train/validation folds repeatedly.
- (i) Selecting variables / feature selection: CV error is used to compare subsets of features and choose set with lowest validation error, avoiding overfitting.
- (ii) Comparing predictors / model selection: Compare different model families (e.g., linear vs tree vs SVM) on CV score.
- (iii) Electing / selecting parameters in prediction function (hyperparameter tuning): e.g., choosing in KNN, in ridge, , in SVM via grid search with CV. Also called hyperparameter optimization.
Since all three are standard applications, (iv) All of the above is correct.
Additional note: CV does not train final model; after selection, model is retrained on full training data and evaluated on held-out test set.
Q1b. Which of the following statement(s) is/are true for Gradient Decent (GD) and Stochastic Gradient Decent (SGD)? (1) In GD and SGD, you update a set of parameters in an iterative manner to function. minimize the error (2) In SGD, you have to run through all the samples in your training set for a single update of a parameter in each iteration. (3) In GD, you either use the entire data or a subset of training data to update a parameter in each iteration. (i) Only (1) (ii) (1) and (2) only (iii) (3) and (2) only (iv) (1), (2) and (3)20222m
Module 1: Introduction
View this question on its own page →Which of the following statement(s) is/are true for Gradient Decent (GD) and Stochastic Gradient Decent (SGD)?
(1) In GD and SGD, you update a set of parameters in an iterative manner to function. minimize the error
(2) In SGD, you have to run through all the samples in your training set for a single update of a parameter in each iteration.
(3) In GD, you either use the entire data or a subset of training data to update a parameter in each iteration.(i) Only (1)
(ii) (1) and (2) only
(iii) (3) and (2) only
(iv) (1), (2) and (3)Worked SolutionAnswer: (i) Only (1) — as per correct ML theory. Note many exam keys incorrectly mark (ii) due to typo; clarified below.
Statement analysis:
(1) In GD and SGD, you update a set of parameters iteratively to minimize the error — TRUE. Both are iterative optimization algorithms: $w := w - \eta
abla J(w)$.(2) In SGD you have to run through all samples for a single update — FALSE. SGD uses one randomly chosen sample (or one mini-batch) per update. Statement describes Batch GD, not SGD. This is a common textbook error in the question.
(3) In GD you either use entire data or subset to update — FALSE. Standard GD uses entire training set per update. Using a subset is Mini-batch GD or SGD, not vanilla GD.
Strictly: only (1) is true → (i) Only (1). If exam expects (ii) or (iii), it has swapped definitions. Conceptual correct behavior:
- GD: one update per epoch using all examples — expensive but stable.
- SGD: one update per example — noisy but fast, frequent updates.
- Mini-batch: compromise (e.g., 32/64 samples).
Q1c. What makes the difference between good decisions and bad decisions? (i) A good decision is based on logic (ii) A good decision considers all available data (iii) A good decision considers all alternatives (iv) A good decision applies quantitative approaches20222m
Module 2: Linear Models and Bayesian Learning
View this question on its own page →What makes the difference between good decisions and bad decisions?
(i) A good decision is based on logic
(ii) A good decision considers all available data
(iii) A good decision considers all alternatives
(iv) A good decision applies quantitative approachesWorked SolutionAnswer: (iv) A good decision applies quantitative approaches — though in ML/decision theory all (i)-(iii) also contribute, expected exam answer is (iv).
Explanation:
In Statistical Decision Theory / ML:
- Good decisions are not just based on logic (i) alone — logic without data is insufficient.
- Considering all data (ii) and all alternatives (iii) are part of rational decision making, but alone not distinctive.
- Quantitative approaches (iv) — using probability, expected loss/risk , utility, optimization — differentiate good from bad decisions objectively. This aligns with Bayesian decision theory, where you choose action .
Textbook often phrases: "A good decision is based on logic, considers all available data and alternatives, and applies quantitative approaches." If single best is asked, (iv) captures the statistical/ML perspective (quantitative risk minimization) that the other options miss. If multiple correct, (ii)+(iii)+(iv) would be joint.
Q1d. Where does the Bayes rule can be used? (i) Solving queries (ii) Increasing complexity (iii) Decreasing complexity (iv) Answering probabilistic query20222m
Module 2: Linear Models and Bayesian Learning
View this question on its own page →Where does the Bayes rule can be used?
(i) Solving queries
(ii) Increasing complexity
(iii) Decreasing complexity
(iv) Answering probabilistic queryWorked SolutionAnswer: (iv) Answering probabilistic query — (i) Solving queries is also acceptable but (iv) is more precise.
Explanation:
Bayes Rule:
Uses:
- Answering probabilistic queries — compute posterior , e.g., .
- Solving queries in Bayesian networks: Inference via enumeration, variable elimination, MCMC.
- Classification (Naive Bayes):
- Updating beliefs with evidence, spam filtering, medical diagnosis.
It does NOT increase/decrease complexity inherently; it enables probabilistic reasoning.
Hence (iv) Answering probabilistic query is textbook best. (i) Solving queries is vague but related — if single choice forced, pick (iv).
Q1e. Which of the following steps/assumptions in regression modeling impacts the trade-off between under-fitting and over-fitting the most? (i) The polynomial degree (ii) Whether we learn the weights by matrix inversion or gradient descent (iii) The use of a constant-term (iv) None of the above20222m
Module 2: Linear Models and Bayesian Learning
View this question on its own page →Which of the following steps/assumptions in regression modeling impacts the trade-off between under-fitting and over-fitting the most?
(i) The polynomial degree
(ii) Whether we learn the weights by matrix inversion or gradient descent
(iii) The use of a constant-term
(iv) None of the aboveWorked SolutionAnswer: (i) The polynomial degree
Explanation — Underfitting vs Overfitting trade-off:
Model complexity controls bias-variance trade-off. Polynomial degree directly controls capacity:
- Degree=1 (linear) — high bias, may underfit non-linear data
- Degree too high (e.g., 10 for 20 points) — low bias but high variance, overfits noise, oscillates
(ii) Whether we learn weights by matrix inversion vs gradient descent — Both solve same optimization vs iterative; they reach same (if convex), so no impact on generalization.
(iii) Use of constant-term (bias ) — Important to fit intercept, but small impact compared to degree. Without bias, model forced through origin — may underfit slightly, but not as dramatic as degree change.
Thus degree (i) is the dominant hyperparameter governing over/under-fitting.
Other factors affecting trade-off: regularization , training set size, early stopping.
Q1f. Which of the following is true about Naive Bayes? (i) Assumes that all the features in a dataset are equally important (ii) Assumes that all the features in a dataset are independent (ii) Both (i) and (ii) (iv) None of the above20222m
Module 3: Classification Algorithms
View this question on its own page →Which of the following is true about Naive Bayes?
(i) Assumes that all the features in a dataset are equally important
(ii) Assumes that all the features in a dataset are independent
(ii) Both (i) and (ii)
(iv) None of the aboveWorked SolutionAnswer: (ii) Assumes that all features are independent (given the class) — note option numbering duplicate, intended as (ii). Strictly Naive Bayes assumes conditional independence; (i) is not an assumption.
Clarification:
Naive Bayes classifier:
- Assumption: Features are conditionally independent given class . That is (ii) essentially. This is strong/naive.
- It does NOT assume all features equally important (i) — importance is implicitly learned via likelihoods; correlated important features still get weight. Equal importance is not required.
- The option list has typo: second (ii) should be (iii) Both (i) and (ii). Since (i) is false, Both is false.
- Therefore correct is only independence assumption → (ii). Some keys mark (ii) Both due to loose teaching, but precise answer is independence only.
If exam expects textbook shortcut "Naive Bayes assumes independence and equal importance", some mark (iii) Both — mention this nuance.
Q1g. The feature of ANN in which ANN creates its own organization or representation of information it receives during learning time is (i) adaptive learning (ii) self-organization (iii) what-if analysis (iv) supervised learning20222m
Module 3: Classification Algorithms
View this question on its own page →The feature of ANN in which ANN creates its own organization or representation of information it receives during learning time is
(i) adaptive learning
(ii) self-organization
(iii) what-if analysis
(iv) supervised learningWorked SolutionAnswer: (ii) self-organization
Explanation:
ANN features:
- Adaptive learning (i): Ability to learn to perform tasks based on data.
- Self-organization (ii): ANN creates its own representation/organization of information it receives during learning — weights self-adjust to capture structure. Best exemplified by Kohonen Self-Organizing Maps (SOM) and also hidden layer representations in general ANNs.
- What-if analysis is not ANN-specific.
- Supervised learning requires external target labels.
The phrase "creates its own organization of information it receives during learning time" is textbook definition of self-organization (also called self-organisation / unsupervised adaptation).
Hence (ii) self-organization.
Q1h. Which of the following is true about averaging ensemble? (i) It can only be used in classification problem (ii) It can only be used in regression problem (ii) It can be used in both classification as well as regression (iv) None of the above20222m
Module 3: Classification Algorithms
View this question on its own page →Which of the following is true about averaging ensemble?
(i) It can only be used in classification problem
(ii) It can only be used in regression problem
(ii) It can be used in both classification as well as regression
(iv) None of the aboveWorked SolutionAnswer: (iii) It can be used in both classification as well as regression — corrected from typo second (ii)
Explanation — Averaging Ensemble:
- Bagging / Voting / Averaging: Train base learners on bootstrap samples, average predictions: for regression, or soft voting / probability averaging for classification.
- Classification: averaging predicted probabilities or logits, e.g., Random Forest classification by majority vote (which is averaging indicator) or averaging probabilities.
- Regression: direct average of continuous outputs, e.g., Random Forest regressor.
- Reduces variance, improves generalization.
So NOT limited to only classification or only regression. Hence (iii) Both (intended as third option despite mislabeled).
Options had typo: listed (ii) twice; correct mapping: (iii) It can be used in both...
Q1i. What is the minimum number of variables/features required to perform clustering? (i) 0 (ii) 1 (iii) 2 (iv) 320222m
Module 4: Clustering, K-means, K-medoids, Density-based Hierarchical, Spectral .
View this question on its own page →What is the minimum number of variables/features required to perform clustering?
(i) 0
(ii) 1
(iii) 2
(iv) 3Worked SolutionAnswer: (ii) 1
Explanation:
- Clustering (K-means, hierarchical, DBSCAN) groups data points by similarity in feature space.
- Requires at least 1 feature/variable to compute distance/similarity. With 0 features there is no data to cluster.
- With 1 feature, 1D clustering is valid (e.g., points on a line clustered by value: {1,2,10} → clusters {1,2} and {10} via 1D K-means).
- While typically we use features for visualization, minimum mathematically is 1.
Therefore (ii) 1 is correct.
Q2a. Give the three computer applications for which machine learning approaches seem appropriate and three for which they seem inappropriate.20227m
Module 1: Introduction
View this question on its own page →Give the three computer applications for which machine learning approaches seem appropriate and three for which they seem inappropriate.
Worked SolutionThree Applications Where ML is Appropriate (pattern-based, large data, no explicit rule):
- Handwritten Digit/ Face Recognition: Too many variations to code rules; learn from examples (MNIST, CNN). Data abundant, pattern statistical.
- Spam Email Filtering / Recommendation Systems: User preferences shift, need adaptation from labeled feedback; probabilistic text features ideal for Naive Bayes / collaborative filtering.
- Speech Recognition / Machine Translation / Medical Diagnosis from images: No exact algorithmic solution, benefits from deep learning on large datasets (e.g., tumor detection from X-rays).
Three Where ML is Inappropriate (deterministic, exact, safety-critical, small data):
- Simple Arithmetic / Payroll Calculation / Sorting: Exact algorithmic solution exists, 100% accuracy required; ML would approximate and err.
- Real-time Safety-Critical Control with Formal Guarantees (e.g., Aircraft flight control certification, Nuclear reactor shutdown): Need provable correctness, interpretability; ML black-box unreliable, hard to verify.
- Problems with No Data / No Pattern (e.g., determining a cryptographic hash inverse, generating truly random numbers, or one-off legal reasoning requiring causal explanation): ML needs historical data; if data absent or task requires deductive reasoning/common sense not statistical correlation, ML fails.
Criteria: ML appropriate when: large data, pattern exists but not analytically describable, tolerance for probabilistic error, adaptation needed. Inappropriate when: exact solution exists, need guarantee, no data, or solution requires reasoning beyond correlation.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q2b. What is decision tree algorithm? What are the issues in decision tree induction?20227m
Module 3: Classification Algorithms
View this question on its own page →What is decision tree algorithm? What are the issues in decision tree induction?
Worked SolutionDecision Tree Algorithm:
Tree where internal nodes test attribute, branches = values, leaves = class. Learns by greedy top-down, divide-and-conquer.Algorithm (ID3/C4.5):
- If all examples same class or attributes empty → leaf.
- Choose best attribute by Information Gain (or Gain Ratio, Gini).
- Split by values, recurse on subsets.
Entropy:
Issues in Decision Tree Induction:
- Choosing attribute selection measure: Gain biases to many-valued attributes → Gain Ratio (C4.5) or Gini (CART).
- Overfitting: Tree grows until pure, memorizes noise. Solutions: pre-pruning (stop early, min samples/chi-square), post-pruning (reduced-error pruning, cost-complexity), validation set.
- Underfitting / Bias: Too shallow tree misses pattern.
- Handling continuous attributes: Need discretization — find best split threshold .
- Handling missing values: Surrogate splits, fractional examples, imputation (C4.5).
- Incorporating costs / noisy data: Different misclassification costs, pruning for noise robustness.
- Inconsistent data / Large hypothesis space: Exponential possible trees; greedy may get local optimum, not globally optimal (NP-hard).
- Instability: Small data change → large tree change; ensemble methods (Random Forest) mitigate.
- Class imbalance, oblique splits, scalability for large datasets.
Q3a. Define how Bayesian networks and Markov random fields are used to represent probability distributions, and briefly describe the trade-offs involved in choosing one versus the other.20227m
Module 5: Probabilistic & Reinforcement Methods
View this question on its own page →Define how Bayesian networks and Markov random fields are used to represent probability distributions, and briefly describe the trade-offs involved in choosing one versus the other.
Worked SolutionBayesian Networks (BN) vs Markov Random Fields (MRF):
Both are Probabilistic Graphical Models representing joint distribution via graph factorization.
Bayesian Networks — Directed Acyclic Graph (DAG):
- Nodes = random variables, directed edges = direct dependencies (parent → child = causal).
- Factorization: (chain rule with conditional independence via d-separation).
- Need Conditional Probability Tables (CPTs) for discrete nodes.
- Represents causal / asymmetric dependencies, natural for generative processes (e.g., disease → symptom).
- Inference: exact (variable elimination, junction tree) NP-hard; approx MCMC.
- Learning: DAG structure learning NP-hard, parameter learning via MLE.
Markov Random Fields — Undirected Graph:
- Nodes linked by undirected edges, factorization over cliques via potentials : where (partition function, global normalization).
- Represents symmetric / non-causal correlations, spatial interactions (e.g., pixels in image — neighboring pixels similar, Ising model).
- Conditional independence via graph separation.
- No CPTs, more flexible for cyclic dependencies.
Trade-offs:
Aspect BN MRF Edge meaning Causal, directed Correlation, undirected Normalization Local (each CPT sums to 1) Global — expensive Cycles Cannot handle directed cycles Handles cycles naturally Interpretability High (causal) Lower Learning complexity Structure NP-hard but local norm easy Potential learning hard, intractable Inference Slightly cheaper if DAG sparse Often costlier due to Use cases Diagnosis, causal reasoning, time series (DBN) Image segmentation, stereo, spatial stats Choosing: Use BN when direction/causality known, need generative sampling, DAG natural. Use MRF when dependencies symmetric, lattice-like, or cyclic correlations (images, social networks). Many distributions can be represented by either with transformations (moralization), but efficiency differs.
Q3b. What is regression analysis? What are the differences between linear regression and ridge regression?20227m
Module 2: Linear Models and Bayesian Learning
View this question on its own page →What is regression analysis? What are the differences between linear regression and ridge regression?
Worked SolutionRegression Analysis: Statistical process for estimating relationships among variables. Predict continuous dependent from independent . Model . Used for prediction, inference of variable importance, trend estimation.
Types: Simple linear, multiple linear, polynomial, ridge/lasso, logistic (classification), non-linear.
Linear Regression:
- Model: ,
- Assumes linear relationship, homoscedasticity.
- OLS solution:
- Loss:
- Suffers when singular/multicollinear, overfits with many features, sensitivity to outliers.
Ridge Regression (L2 Regularized):
- Loss: ,
- Solution:
- Adds bias but reduces variance (bias-variance trade-off), handles multicollinearity by shrinking coefficients, always invertible.
- Does feature shrinkage, not selection (all non-zero). Lasso () does selection.
Aspect Linear Ridge Penalty none Coefficients unbiased, high variance if collinear biased (shrink toward 0), lower variance When fails works Hyperparameter none via CV Interpretability direct shrunk values Ridge is preferred when multicollinearity, high dimensional or overfitting risk.
Q4. Explain how the linear maximum-margin classifier can be modified to be non-linear and to allow misclassification of the training examples. Give a derivation of the modified optimization problem needed for training. You need only derive a statement of the primal optimization problem.202214m
Module 3: Classification Algorithms
View this question on its own page →Explain how the linear maximum-margin classifier can be modified to be non-linear and to allow misclassification of the training examples. Give a derivation of the modified optimization problem needed for training. You need only derive a statement of the primal optimization problem.
Worked SolutionLinear Maximum-Margin Classifier (Hard SVM):
Primal: s.t. ,
Margin , support vectors satisfy equality. Only linear separable case, no slack.
Modifications for Non-linear and Non-separable:
Allow misclassification (Soft Margin): Introduce slack :
. violates margin, misclassifies. Add penalty .Make Non-linear via Feature Map and Kernel: Map to higher dimension where linear separation possible. Replace with . Kernel trick: avoids explicit high-dim computation (Polynomial, RBF).
Derivation — Primal for Soft-Margin Non-linear SVM:
Minimize over :
s.t. , ,- First term maximizes margin ().
- Second penalizes violations; trades margin width vs training error (small wider margin more violations, large hard margin approx).
- = hinge loss.
If separable, optimum recovers hard margin. Non-linear version retains same form with . Dual leads to and kernelized decision .
Without slack & kernel, linear separable only; with them, general-purpose classifier.
Q5. Following is a data set that contains two attributes, X and Y, and two class labels, ‘+’ and ‘–’. Each attribute can take three different values: 0, 1, or 2. The concept for the ‘+’ class is Y = 1 and the concept for the ‘–’ class is X = 0 ∨ X = 2.  (a) Build a decision tree on the data set. Does the tree capture the ‘+’ and ‘–’ concepts? (b) What are the accuracy, precision, recall and F1-measure of the decision tree? (Note that precision, recall, and F1-measure are defined with respect to the ‘+’ class.)202214m
Module 3: Classification Algorithms
View this question on its own page →Following is a data set that contains two attributes, X and Y, and two class labels, ‘+’ and ‘–’.
Each attribute can take three different values: 0, 1, or 2.The concept for the ‘+’ class is Y = 1
and the concept for the ‘–’ class is X = 0 ∨ X = 2.
(a)
Build a decision tree on the data set.
Does the tree capture the ‘+’ and ‘–’ concepts?(b)
What are the accuracy, precision, recall and F1-measure of the decision tree?
(Note that precision, recall, and F1-measure are defined with respect to the ‘+’ class.)Q6a. Explain the model of over-fitting and under-fitting. Give the example of over-fitting and under-fitting in two-dimensional data.20227m
Module 1: Introduction
View this question on its own page →Explain the model of over-fitting and under-fitting. Give the example of over-fitting and under-fitting in two-dimensional data.
Worked SolutionOverfitting and Underfitting:
Overfitting: Model learns training data too well, including noise/outliers; high variance, low bias. Memorization. . Example: Degree-10 polynomial fitting 10 points with wiggling curve passing through all points.
Underfitting: Model too simple to capture underlying pattern; high bias, low variance. but both high. Example: Linear line fitting parabolic data.
Model complexity view: Train vs Validation error vs capacity (U-shaped test error). Optimal is intermediate capacity (sweet spot) where bias-variance balanced.
2D Example:
Data: Parabolic trend , points near U-shape.
Underfit (linear, degree 1): Straight line cutting through U, misses curvature → large error on both train and test.
y * * \ / data * . linear ___ (misses curve) / \ * *Good fit (degree 2): Parabola captures trend smoothly, generalizes.
Overfit (degree 9+): Wiggly curve passing exactly through every noisy point, oscillates wildly between points — zero train error but huge test error.
Remedies:
- Underfit: increase complexity, add features, reduce regularization, longer training.
- Overfit: more data, regularization (L1/L2), pruning, dropout, early stopping, cross-validation, feature selection, reduce degree.
Visual: Plot vs , noisy quadratic data; underfit = straight line under, overfit = wiggly interpolating, good = smooth quadratic.
Q6b. Explain the bagging and boosting with example.20227m
Module 3: Classification Algorithms
View this question on its own page →Explain the bagging and boosting with example.
Worked SolutionBagging and Boosting (Ensemble Methods):
Both combine weak learners (e.g., decision trees) to strong ensemble but differ in strategy.
Bagging (Bootstrap Aggregating) — Breiman:
- Create bootstrap samples (sample with replacement, size ) from training data.
- Train one base learner on each sample in parallel, e.g., deep trees in Random Forest.
- Aggregate: Classification majority vote, Regression averaging:
- Reduces variance, prevents overfitting, robust to noise.
- Example: Random Forest bagging 100 trees on loan default data, each tree sees 63% unique rows + random feature subset, vote gives stable prediction. Out-of-bag error estimates generalization without CV.
Boosting (e.g., AdaBoost, Gradient Boosting):
- Sequential. Train weak learners (stumps) iteratively; each new learner focuses on previously misclassified weighted examples.
- AdaBoost: Maintain weights ; initially , increase weight for misclassified, decrease for correct. Final prediction weighted vote where .
- Gradient Boosting: Fits new learner to residual (negative gradient of loss) .
- Reduces bias (+ variance), converts weak → strong, but prone to overfit if noisy; sequential not easily parallel.
Comparison:
Bagging Boosting Data Bootstrap subsets Weighted full data, adaptive Training Parallel, independent Sequential, dependent Reduces Variance Bias Sensitivity to noise Robust Sensitive Example learners Full trees Shallow stumps Example: Bagging on noisy medical data stable; Boosting on same achieves higher accuracy but may overfit unless early stopping/shrinkage.
Q7. Discuss the steps in K-means algorithm and evaluate the following table using K-means : 202214m
Module 3: Classification Algorithms
View this question on its own page →Discuss the steps in K-means algorithm and evaluate the following table using K-means :

Q8a. What is the difference between K-means and K-medoid algorithm? Explain density-based hierarchical clustering.20227m
Module 4: Clustering, K-means, K-medoids, Density-based Hierarchical, Spectral .
View this question on its own page →What is the difference between K-means and K-medoid algorithm? Explain density-based hierarchical clustering.
Worked SolutionK-means vs K-medoid:
Aspect K-means (Lloyd) K-medoid (PAM) Center Centroid = mean (not necessarily data point, continuous) Medoid = actual data point minimizing sum distance to cluster members Distance Euclidean (minimizes SSE) Any metric (Manhattan, arbitrary dissimilarity) Robustness Sensitive to outliers (mean shifts) Robust (medoid not affected by extreme outlier) Cost function Complexity fast per iteration (PAM) much slower, for large data When to use Continuous, spherical clusters, fast Categorical/mixed, need representatives from dataset, noisy data Density-Based Hierarchical Clustering:
Combines density and hierarchy. Unlike flat K-means, builds tree (dendrogram) where clustering reflects density connectivity at different thresholds.
Core idea: Clusters are dense regions separated by sparse regions. Define -neighborhood and . Point types: core (≥ in ), border, noise. Hierarchical variant (e.g., HDBSCAN, OPTICS, DENCLUE hierarchical) varies /density threshold to create hierarchy.
OPTICS: Ordering Points To Identify Clustering Structure — computes reachability distance, produces reachability plot, extracts hierarchy without fixing single .
HDBSCAN: Converts DBSCAN to hierarchical, builds minimum spanning tree of mutual reachability, condenses, selects stable clusters via persistence .
Hierarchical density dendrogram: Bottom leaves = core points merge at lowest density threshold as increases.
Advantages: Finds arbitrary shapes, handles noise, no need to preset , hierarchy reveals clusters at multiple densities.
Steps generic: Estimate density (kernel), build graph where edges if density > threshold, connected components = clusters, vary threshold → hierarchy, prune unstable branches.
Q8b. What is ANN? Explain feed forward and back propagation algorithm with example.20227m
Module 3: Classification Algorithms
View this question on its own page →What is ANN? Explain feed forward and back propagation algorithm with example.
Worked SolutionArtificial Neural Network (ANN):
Computational model inspired by biological neurons. Network of interconnected units (neurons) that processes inputs via weighted sums and non-linear activations to learn mappings.
- Neuron: , where is activation (sigmoid , tanh, ReLU ).
- Architecture: Input layer → one or more hidden layers → output layer. Fully connected. Depth determines representation power.
Feedforward Algorithm:
Information flows forward only, no cycles.- Initialize weights small random.
- For each layer :
- At output, compute loss or cross-entropy.
- Example: 2-input XOR with hidden 2 neurons: , .
Backpropagation Algorithm:
Efficient gradient computation via chain rule to train weights.- Forward pass as above, store .
- Output error
- Propagate backward:
- Gradients
- Update , (SGD).
- Iterate over epochs until convergence.
Example with numbers: Single neuron with sigmoid, input 0.5, target 1, , , , , , → weight increases.
Feedforward computes prediction; backprop assigns blame and updates weights to reduce loss, enabling learning of non-linear boundaries.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q9a. Write short notes on the following: (a) Partial least square20227m
Module 2: Linear Models and Bayesian Learning
View this question on its own page →Write short notes on the following:
(a) Partial least squareWorked Solution(a) Partial Least Squares (PLS):
PLS is dimensionality reduction + regression method for high-dimensional, multicollinear, data (e.g., chemometrics, genomics).
Goal: Find latent components that maximize covariance between (predictors) and (responses), not just variance of like PCA.
Idea: Decompose , with , latent scores, weights maximize .
Algorithm (NIPALS):
- Center/scale .
- For component : compute weight (for univariate ) normalized, , , , deflate , .
- Regression yields .
Types: PLS1 ( univariate), PLS2 ( multivariate), PLS-DA (classification).
Advantages: Handles multicollinearity, , noisy predictors, stable; gives interpretable latent factors (like PCA but supervised).
Vs PCA/OLS: PCA maximizes , PLS maximizes → better predictive components. OLS fails when singular; PLS works.
Choosing components : Cross-validation (Q² metric).
Example: Predict chemical concentration from 1000-wavelength spectra (highly correlated) with 50 samples → PLS finds 3 latent factors capturing predictive spectra shape.
Q9b. Write short notes on the following: (b) Reinforcement learning20227m
Module 5: Probabilistic & Reinforcement Methods
View this question on its own page →Write short notes on the following:
(b) Reinforcement learningWorked Solution(b) Reinforcement Learning:
Definition: Paradigm where agent learns optimal policy by interacting with environment and maximizing cumulative reward, not from labeled examples but from delayed reward signal.
Components: Agent, Environment, State , Action , Reward , Policy , Value , Model , discount .
Types:
- Model-free: No explicit model; directly learn . Value-based (Q-learning ), Policy-based (REINFORCE $
abla J=E[
abla\log\pi(a|s) Q]$), Actor-Critic. - Model-based: Learn/know , plan via DP (Value Iteration, MCTS in AlphaGo).
- On-policy (SARSA) learns about being followed; off-policy (Q-learning) learns about optimal from any behavior.
Exploration-Exploitation: -greedy, UCB, Thompson, entropy regularization.
Algorithms: Q-learning, SARSA, DQN (deep with replay + target network), Policy Gradient, PPO, A3C.
Challenges: Credit assignment (delayed reward), exploration, instability, sample inefficiency.
Applications: Game playing (AlphaGo, Atari DQN), robotics control, autonomous driving, recommender systems (long-term engagement), finance trading.
Example: Grid maze: states = cells, actions = up/down/left/right, reward +10 goal, -1 wall, agent via Q-learning propagates values back from goal to learn shortest path.
Differences vs supervised: No correct output provided, only reward; sequential, action affects next state (non-i.i.d).
Rewards shape behavior; reward engineering crucial.
- Model-free: No explicit model; directly learn . Value-based (Q-learning ), Policy-based (REINFORCE $
Coursify Android App
Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.