MLT End Term19 questions100 marks9 MSQ · 6 SA · 4 MCQafternoon
Elapsed 00:00
Q1MSQ5 marksselect all that apply
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions.
Q2MCQ5 marks
Suppose the team applies linear PCA on the dataset and reconstructs the data points with zero error using k principal components (directions). For which value of k the reconstruction error would become zero?
1
2
3
4
10
100
Q3MSQ6 marksselect all that apply
Q4MSQ5 marksselect all that apply
Consider Lloyd’s algorithm used for k-means clustering and choose the correct statements:
K-means algorithm may get stuck at local minima.
It guarantees finding the optimal clustering(global minima) in every run.
If the resources are limited and the data set is huge, it will be good to prefer K-means over K-means++.
In practice, k should be as large as possible.
Q5SA6 marks
Q6SA6 marks
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions.
Q7MCQ3 marks
7.9
12.2
11.9
None of these
Q8MCQ3 marks
If you further reduce the regularization parameter (λ) to zero. What would be the new prediction for the target variable?
7.9
12.2
11.9
None of these
Q9SA6 marks
Q10SA5 marks
Q11MCQ5 marks
Yes, it will converge.
No, it will never converge.
Insufficient data
Q12SA6 marks
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions.
Q13MSQ6 marksselect all that apply
What is the equation of the decision boundary? Select all options that are correct.
Q14SA5 marks
Q15MSQ6 marksselect all that apply
Q16MSQ6 marksselect all that apply
Which of the following statements are correct?
Underfitting models have high bias and low variance.
Overfitting models have low bias and high variance.
Generally, weak learners in the random forest tend to underfit.
If the performance of each estimator in the bagging algorithm is almostidentical, the benefit of using bagging to combine them may be minimal or insignificant.
In random forests, multiple decision trees (estimators) are trainedsimultaneously, allowing for parallel processing and faster model training.
Q17MSQ5 marksselect all that apply
Model 4 tends to overfit.
Model 4 tends to underfit.
Model 1 tends to underfits.
Model 1 tends to overfits.
Q18MSQ5 marksselect all that apply
Q19MSQ6 marksselect all that apply
Choose all the correct statements about neural networks
It can not be used for both regression and classification problems
It can have more than two hidden layers
The activation functions have to be non-linear to separate not linearlyseparable data points
Each neuron in the neural network may or may not have bias associated with it
Auto-generated summary from the source site. Handy as a checklist; the lessons above explain each idea from scratch.
Here’s a structured summary of core topics, concepts, principles, and equations essential for the exam, followed by Mermaid knowledge graphs to visualize relationships.
Core Topics & Key Concepts
1. Principal Component Analysis (PCA)
Purpose: Dimensionality reduction while preserving variance.
Steps:
Center the data (subtract mean).
Compute covariance matrix: Σ=n1XTX.
Eigen-decomposition: Σ=VΛVT, where V = eigenvectors (principal components), Λ = eigenvalues.
Project data onto top-k eigenvectors.
Key Equations:
Covariance matrix: Σ=n1∑i=1n(xi−μ)(xi−μ)T.
Reconstruction error: Zero if k=d (original dimensions).
First PC: Eigenvector corresponding to the largest eigenvalue.
Example: For dataset D={(−1,1),(0,0),(1,1)}, the first PC is (11).
2. Linear Regression
Model: y=wTx+ϵ.
Loss Function (Squared Error): L(w)=∑i=1n(wTxi−yi)2.
Optimal Weights (Closed-Form): w∗=(XXT)−1Xy (if X is full-rank).
Key Properties:
Minimum loss at w∗ is 0 if data is linearly separable.
For underdetermined systems, infinite solutions exist.
Local minima: Depends on initialization (use K-means++ to mitigate).
Complexity: O(n⋅k⋅d⋅I), where I = iterations.
Choosing k: Elbow method or silhouette score.
Trade-offs:
K-means++ is slower but avoids poor initializations.
Larger k increases computational cost.
4. Decision Trees
Splitting Criteria:
Gini impurity or entropy for classification.
Variance reduction for regression.
Pure Leaves: A leaf is pure if all samples belong to one class.
Example: For binary classification with threshold p in x<p, the number of possible integer p values depends on the sorted unique values of x.
5. Naive Bayes Classifier
Assumption: Features are conditionally independent given the class.
Parameters to Learn:
Class priors: P(y=c) for each class c.
Likelihoods: P(fj=v∣y=c) for each feature fj, value v, and class c.
Example: For 4 classes and 3 binary features, total parameters = 3×2×4+3=27 (but simplified to 15 if features are binary and symmetries are exploited).
6. Perceptron Algorithm
Update Rule: w←w+η⋅yixi if yi(wTxi)≤0.
Convergence: Guaranteed if data is linearly separable and learning rate η is small.
Counterexample: Non-separable data (e.g., XOR) leads to no convergence.
7. Logistic Regression
Model: P(y=1∣x)=σ(wTx), where σ = sigmoid.
Decision Rule: Predict y^=1 if P(y=1∣x)>0.5 (or another threshold).
Example: For w=[3/25/12] and x=[02], compute σ(wTx). If σ(wTx)<0.75, predict 0.
8. Support Vector Machines (SVM)
Hard-Margin SVM:
Optimization: min21∥w∥2 s.t. yi(wTxi+b)≥1.
Decision Boundary: wTx+b=0.
Supporting Hyperplanes: wTx+b=±1.
Margin Width: ∥w∥2.
Soft-Margin SVM:
Allows misclassifications via slack variables ξi.
Optimization: min21∥w∥2+C∑ξi.
Effect of C:
Small C: Wider margin, more misclassifications.
Large C: Narrower margin, fewer misclassifications.
Kernel Trick: For non-linear boundaries, use ϕ(x) (e.g., RBF kernel).
9. Model Evaluation & Bias-Variance Tradeoff
Underfitting:
High bias, low variance.
Poor performance on training and test data.
Overfitting:
Low bias, high variance.
Good training performance but poor generalization.
Diagnostics:
Compare training vs. test error (e.g., Model 1 in Q18 overfits; Model 4 underfits).
10. Ensemble Methods (Bagging & Random Forest)
Bagging:
Train multiple models on bootstrapped samples.
Average predictions (regression) or vote (classification).
Reduces variance.
Random Forest:
Extension of bagging with feature randomness.
Parallelizable (trees are independent).
Weak learners (shallow trees) are preferred to avoid overfitting.