ML Study Hub

Home / Past papers / MLP End Term / this paper

IIT M DIPLOMA AN EXAM QDD4 13 Apr 2025 - 13 Apr 2025

MLP End Term30 questions50 marks20 MCQ · 6 MSQ · 4 SADiploma / afternoon / QDD4
Elapsed 00:00
Q1MCQ1 mark
question figure
  1. [0.25, 1, 0, 0]
  2. [0.5, 0, 1, 0]
  3. [0, 1, 0, 0]
  4. [1, 0, 0, 1]
Q2MCQ1 mark
Consider the following code snippet: question figure Consider the following code snippet:
  1. (20640, 8)
  2. (20640, 5)
  3. (20640, 44)
  4. (20640, 49)
Q3MCQ1 mark
question figure
  1. 13.6
  2. 14.0
  3. 14.2
  4. 14.5
Q4MCQ1 mark
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q5MCQ1 mark
What is the primary computational bottleneck of the KNeighborsClassifier?
  1. Training the model.
  2. Choosing the best k value.
  3. Storing and searching through all training samples at prediction time.
  4. Calculating class probabilities.
Q6MCQ2 marks
The following code attempts to implement Ridge regression on the Boston housing dataset but contains an error. The missing part should be correctly filled in to avoid issues during training. question figure The following code attempts to implement Ridge regression on the Boston housing dataset but contains an error. The missing part should be correctly filled in to avoid issues during training. Which of the following correctly fills the missing part while ensuring proper preprocessing?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q7MCQ2 marks
Which of the following techniques can be used for hyperparameter tuning in SGD Regression?
  1. GridSearchCV
  2. ElasticNetCV
  3. SelectKBest
  4. Feature Scaling with StandardScaler
Q8MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q9MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q10MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q11MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q12MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q13MCQ2 marks
question figure
  1. It decides how many features are to be considered by each of the estimators
  2. It signifies the influence of each estimator towards the prediction
  3. It offers the order in which each estimator is considered before making aprediction
  4. It provides weights to different classes in a multiclass classification problem
Q14MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q15MCQ3 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q16MCQ3 marks
question figure
  1. The predicted classes for the new data points.
  2. The decision boundary values for the classes.
  3. The posterior probabilities of the classes for the new data points.
  4. The likelihood estimates for the new data points.
Q17MSQ3 marksselect all that apply
Which of the following statements are true with regard to logistic regression?
  1. The decision boundary of a logistic regression model is always a straight line.
  2. The solver parameter in logistic regression determines the optimizationalgorithm used for training the model.
  3. Logistic regression can naturally handle multi-class classification without anymodifications.
  4. The regularization strength in logistic regression can be controlled using the Cparameter.
Q18MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q19MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q20MSQ2 marksselect all that apply
In top-down hierarchical clustering, clusters are recursively split until each data point is its own cluster. The choice of a distance metric plays a crucial role in determining the quality of clustering. Which of the following distance (similarity) metrics are commonly used in hierarchical clustering?
  1. Euclidean Distance
  2. Tree Distance
  3. Centroid Distance
  4. Minkowski Distance
Q21MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q22MSQ1 markselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q23SA1 mark
question figure
Q24SA2 marks
question figure
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions. question figure
Q25MCQ1 mark
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q26MCQ1 mark
Which option will help in filtering data to find females who are alive after titanic incident ?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q27MCQ1 mark
What is the given code below trying to accomplish for the given titanic dataset ? question figure What is the given code below trying to accomplish for the given titanic dataset ?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions. question figure
Q28MCQ1 mark
Consider the following and select the corrrect option: Assertion: This is a good model as we see a very high accuracy of 97% Reason: In the case of imbalanced datasets, accuracy might not be the best metric for evaluating a model
  1. Both the assertion and reason are correct, and the reason is a correctexplanation of the assertion
  2. Both the assertion and reason are correct, but the reason is not a correctexplanation of the assertion.
  3. The assertion is correct, but the reason is incorrect.
  4. The assertion is incorrect, but the reason is correct.
Q29SA1 mark
How many points belong to class 1 in the original dataset?
Q30SA1 mark
question figure

Answer key

  1. Q1 (MCQ, 1 marks): A
  2. Q2 (MCQ, 1 marks): D
  3. Q3 (MCQ, 1 marks): B
  4. Q4 (MCQ, 1 marks): A
  5. Q5 (MCQ, 1 marks): C
  6. Q6 (MCQ, 2 marks): A
  7. Q7 (MCQ, 2 marks): A
  8. Q8 (MCQ, 2 marks): C
  9. Q9 (MCQ, 2 marks): B
  10. Q10 (MCQ, 2 marks): B
  11. Q11 (MCQ, 2 marks): C
  12. Q12 (MCQ, 2 marks): D
  13. Q13 (MCQ, 2 marks): B
  14. Q14 (MCQ, 2 marks): D
  15. Q15 (MCQ, 3 marks): B
  16. Q16 (MCQ, 3 marks): C
  17. Q17 (MSQ, 3 marks): B, D
  18. Q18 (MSQ, 2 marks): A, C
  19. Q19 (MSQ, 2 marks): A, B, C
  20. Q20 (MSQ, 2 marks): A, D
  21. Q21 (MSQ, 2 marks): A, C
  22. Q22 (MSQ, 1 marks): A, C
  23. Q23 (SA, 1 marks): 9.2
  24. Q24 (SA, 2 marks): 0.20
  25. Q25 (MCQ, 1 marks): A
  26. Q26 (MCQ, 1 marks): A
  27. Q27 (MCQ, 1 marks): C
  28. Q28 (MCQ, 1 marks): D
  29. Q29 (SA, 1 marks): 73
  30. Q30 (SA, 1 marks): 0.99

Concepts this paper tests

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 Diploma Level: Machine Learning Practice (Computer-Based Exam), along with Mermaid knowledge graphs to visualize relationships.


1. Core Topics & Concepts

A. Data Preprocessing

Key Concepts:

  1. Scaling/Normalization:

    • MinMaxScaler: Scales features to [0, 1] range.
Xscaled=X−XminXmax−XminX_{\text{scaled}} = \frac{X - X_{\text{min}}}{X_{\text{max}} - X_{\text{min}}}
Xscaled=X−μσX_{\text{scaled}} = \frac{X - \mu}{\sigma}
  1. Encoding Categorical Data:

    • One-Hot Encoding: Converts categorical variables into binary vectors.
    • Label Encoding: Assigns a unique integer to each category.
  2. Handling Missing Data:

    • df.isnull().sum(): Counts NULL values.
    • df.fillna(): Imputes missing values.
  3. Polynomial Features:

    • Generates polynomial combinations of features (e.g., X12,X1X2X_1^2, X_1X_2).
    • Number of features for degree d and n original features:
(n+dd)\binom{n + d}{d}
  1. PCA (Principal Component Analysis):

    • Reduces dimensionality by projecting data onto principal components.
    • n_components: Number of principal components to retain.

Key Equations:

TechniqueEquation
MinMax ScalingXscaled=X−XminXmax−XminX_{\text{scaled}} = \frac{X - X_{\text{min}}}{X_{\text{max}} - X_{\text{min}}}
Standard ScalingXscaled=X−μσX_{\text{scaled}} = \frac{X - \mu}{\sigma}
Polynomial Features(n+dd)\binom{n + d}{d} (for degree d and n features)

B. Supervised Learning

Key Algorithms:

  1. Linear Models:

    • Ridge Regression (L2 Regularization):
Cost=MSE+α∑i=1nwi2\text{Cost} = \text{MSE} + \alpha \sum_{i=1}^{n} w_i^2
Cost=MSE+α∑i=1n∣wi∣\text{Cost} = \text{MSE} + \alpha \sum_{i=1}^{n} |w_i|
ηt=η0tpower_t\eta_t = \frac{\eta_0}{t^{\text{power\_t}}}
  1. Logistic Regression:

    • Decision Boundary: Not always linear (depends on features).
    • Regularization: Controlled by C (inverse of regularization strength).
    • Solvers: liblinear, lbfgs, saga (for small/large datasets).
  2. Naïve Bayes:

    • Assumes feature independence given the class.
    • Types:

      • GaussianNB: For continuous data.
      • BernoulliNB: For binary features.
      • MultinomialNB: For discrete counts (e.g., text classification).
  3. Support Vector Machines (SVM):

    • Kernel Trick: Transforms data into higher dimensions (linear, poly, rbf, sigmoid).
    • Regularization: C controls trade-off between margin width and classification error.
  4. k-Nearest Neighbors (k-NN):

    • Distance Metrics: Euclidean, Manhattan (p=1), Minkowski.
    • Computational Bottleneck: Prediction time (searches entire training set).
  5. Ensemble Methods:

    • AdaBoost: Boosts weak learners; learning_rate controls contribution of each tree.
    • Random Forest:

      • max_features: Number of features considered for splits.
      • bootstrap: Whether to sample with replacement.
      • oob_score: Out-of-bag error for generalization estimate.
    • Voting Classifier: Combines predictions from multiple models; weights control influence.

Key Equations:

AlgorithmKey Equation/Parameter
Ridge RegressionCost=MSE+α∑wi2\text{Cost} = \text{MSE} + \alpha \sum w_i^2
Lasso RegressionCost=MSE+α∑∣wi∣\text{Cost} = \text{MSE} + \alpha \sum |w_i|
SGD Learning Rateηt=η0tpower_t\eta_t = \frac{\eta_0}{t^{\text{power\_t}}} (invscaling)
SVM MarginMaximize 1∣∣w∣∣\text{Maximize } \frac{1}{||w||} (margin width)
k-NN Distanced(x,y)=(∑∣xi−yi∣p)1/pd(\mathbf{x}, \mathbf{y}) = \left( \sum |x_i - y_i|^p \right)^{1/p} (Minkowski)

C. Unsupervised Learning

Key Algorithms:

  1. k-Means Clustering:

    • Initialization: k-means++ spreads initial centroids to avoid poor clusters.
    • Objective: Minimize within-cluster sum of squares (WCSS).
    • Elbow Method: Plots WCSS vs. k to find optimal k.
    • Silhouette Score: Measures cluster separation/cohesion.
  2. Hierarchical Clustering:

    • Linkage Methods: Single, complete, average, centroid.
    • Distance Metrics: Euclidean, Manhattan, Minkowski.

Key Equations:

TechniqueEquation
k-Means ObjectiveMinimize ∑i=1k∑x∈Ci∣∣x−μi∣∣2\text{Minimize } \sum_{i=1}^{k} \sum_{\mathbf{x} \in C_i} ||\mathbf{x} - \mu_i||^2
Silhouette Scores=b−amax⁡(a,b)s = \frac{b - a}{\max(a, b)} (where aa = intra-cluster distance, bb = inter-cluster distance)

D. Model Evaluation

Key Metrics:

  1. Classification:

    • Accuracy: TP+TNTP+TN+FP+FN\frac{\text{TP} + \text{TN}}{\text{TP} + \text{TN} + \text{FP} + \text{FN}}
    • Precision: TPTP+FP\frac{\text{TP}}{\text{TP} + \text{FP}}
    • Recall (Sensitivity): TPTP+FN\frac{\text{TP}}{\text{TP} + \text{FN}}
    • F1-Score: 2×Precision×RecallPrecision+Recall2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}
    • Confusion Matrix: TP, TN, FP, FN.
  2. Regression:

    • MSE (Mean Squared Error): 1n∑(yi−y^i)2\frac{1}{n} \sum (y_i - \hat{y}_i)^2
    • R² Score: 1−SSresSStot1 - \frac{\text{SS}_{\text{res}}}{\text{SS}_{\text{tot}}}
  3. Imbalanced Data:

    • Accuracy can be misleading; use precision-recall curves or F1-score.

Key Equations:

MetricEquation
AccuracyTP+TNTP+TN+FP+FN\frac{\text{TP} + \text{TN}}{\text{TP} + \text{TN} + \text{FP} + \text{FN}}
PrecisionTPTP+FP\frac{\text{TP}}{\text{TP} + \text{FP}}
RecallTPTP+FN\frac{\text{TP}}{\text{TP} + \text{FN}}
F1-Score2×Precision×RecallPrecision+Recall2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}
MSE1n∑(yi−y^i)2\frac{1}{n} \sum (y_i - \hat{y}_i)^2

E. Hyperparameter Tuning

Key Methods:

  1. GridSearchCV: Exhaustive search over specified parameter values.
  2. RandomizedSearchCV: Random sampling of parameter combinations.
  3. Cross-Validation: Splits data into k folds for robust evaluation.

F. Neural Networks (MLP)

Key Concepts:


G. Dimensionality Reduction

Key Techniques:

  1. PCA:

    • Transforms data into orthogonal components.
    • n_components: Number of principal components.
  2. Feature Selection:

    • SelectKBest: Selects top k features based on statistical tests.

Graph 2: Supervised Learning Algorithms

Graph 3: Model Evaluation Metrics

Graph 4: Unsupervised Learning

Graph 5: Hyperparameter Tuning


3. Key Takeaways for the Exam

  1. Data Preprocessing:

    • Know when to use MinMaxScaler vs. StandardScaler.
    • Understand OneHotEncoder and PolynomialFeatures.
    • Remember that PCA reduces dimensions but loses interpretability.
  1. Supervised Learning:

    • Ridge/Lasso: L2 vs. L1 regularization.
    • SGDRegressor: Learning rate schedules (invscaling, adaptive).
    • k-NN: Manhattan (p=1) vs. Euclidean (p=2) distance.
    • Ensemble Methods: RandomForest uses max_features and bootstrap.
  1. Model Evaluation:

    • Imbalanced Data: Recall/F1-score > Accuracy.
    • Confusion Matrix: TP, TN, FP, FN.
  1. Unsupervised Learning:

    • k-Means: Use k-means++ for better initialization.
    • Elbow Method/Silhouette Score: For optimal k.
  1. Hyperparameter Tuning:

    • GridSearchCV vs. RandomizedSearchCV.
    • Cross-validation is essential for robust evaluation.
  1. Neural Networks:

    • MLPRegressor requires hidden_layer_sizes and solver.
    • early_stopping prevents overfitting.
  1. Common Pitfalls:

    • Overfitting: Reduce learning_rate in AdaBoost or increase regularization.
    • Scaling: Always scale features for distance-based algorithms (k-NN, SVM, PCA).
    • Imbalanced Data: Avoid accuracy; use precision/recall.