ML Study Hub

Home / Past papers / MLP End Term / this paper

IIT M IMPROVEMENT AN EXAM QIC4 31 Aug - 31 Aug 2025

MLP End Term26 questions50 marks12 MCQ · 8 MSQ · 6 SAImprovement / afternoon / QIC4
Elapsed 00:00
Q1MCQ2 marks
question figure
  1. 10
  2. 50
  3. 100
  4. 500
Q2MCQ2 marks
question figure
  1. Set ‘warm start=True’
  2. Combine training data from different training sessions
  3. Set ‘retain parameters=True’
  4. This problem can not be solved.
Q3MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q4MCQ2 marks
question figure
  1. (200, 200, 3)
  2. (40000, )
  3. (200, 200, 1)
  4. (40000, 3)
Q5MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
Q6MCQ2 marks
Which of the following statements about the Augmented Dickey-Fuller (ADF) test is correct?
  1. The test is used to detect seasonality in a time series
  2. A low p-value (e.g., < 0.05) indicates the time series is non-stationary
  3. The test’s null hypothesis is that the time series is stationary
  4. A low p-value (e.g., < 0.05) indicates the time series is stationary
Q7MCQ1 mark
How to change the loss function in SGDRegressor to Huber loss?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q8MCQ1 mark
question figure
  1. liblinear
  2. lbfgs
  3. saga
  4. newton-cg
Q9MCQ1 mark
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
Q10MCQ3 marks
Which of the following best describes the components of a time series in a classical multiplicative decomposition model?
  1. The series is a product of a trend component and an error component only
  2. The series is a sum of a trend component, a seasonal component, and acyclical component
  3. The series is a product of a trend component, a seasonal component, and anerror component
  4. The series is a sum of a trend component, a seasonal component, and a errorcomponent
Q11MSQ3 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
Q12MSQ2 marksselect all that apply
question figure
  1. Saves computation time by reusing results of expensive transformations wheninputs and parameters have not changed.
  2. Helps speed up repeated runs of cross-validation involving the sametransformation steps.
  3. Reduces CPU usage by running transformations in parallel threadsautomatically.
  4. Improves efficiency in hyperparameter search by avoiding redundantcomputations in pipeline steps.
  5. Guarantees better generalization performance on the test set.
Q13MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q14MSQ2 marksselect all that apply
A medical diagnosis model is used to detect a rare disease that occurs in 0.5% of the population. A model is trained on this data, which of the following evaluation metrics are suitable for measuring effectiveness of this model:
  1. accuracy
  2. precision
  3. recall
  4. F-1 score
Q15MSQ2 marksselect all that apply
question figure
  1. The elbow method involves plotting the number of clusters against the inertiaand identifying a point where the decrease in inertia slows down.
  2. The elbow point represents the cluster count beyond which additional clustersdo not significantly improve the model fit.
  3. The metric used in the elbow method is the silhouette score.
  4. The elbow point is always the smallest number of clusters in the plot.
  5. The elbow method may sometimes be inconclusive if no clear bend is visible inthe curve.
Q16SA3 marks
question figure
Q17SA3 marks
question figure
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions. question figure
Q18MSQ1 markselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q19MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q20MSQ2 marksselect all that apply
question figure
  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
Q21MCQ2 marks
select the appropriate values for A and B in the loss parameter to ensure that all model fits execute successfully.
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q22MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q23SA1 mark
question figure
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions. question figure
Q24SA1 mark
Calculate and enter the value of X (truncated to two decimal places).
Q25SA1 mark
Calculate and enter the value of Y (truncated to two decimal places).
Q26SA3 marks
question figure

Answer key

  1. Q1 (MCQ, 2 marks): A
  2. Q2 (MCQ, 2 marks): A
  3. Q3 (MCQ, 2 marks): A
  4. Q4 (MCQ, 2 marks): B
  5. Q5 (MCQ, 2 marks): A
  6. Q6 (MCQ, 2 marks): D
  7. Q7 (MCQ, 1 marks): A
  8. Q8 (MCQ, 1 marks): C
  9. Q9 (MCQ, 1 marks): A
  10. Q10 (MCQ, 3 marks): C
  11. Q11 (MSQ, 3 marks): A, B
  12. Q12 (MSQ, 2 marks): A, B, D
  13. Q13 (MSQ, 2 marks): A, B, C
  14. Q14 (MSQ, 2 marks): B, C, D
  15. Q15 (MSQ, 2 marks): A, B, E
  16. Q16 (SA, 3 marks): -12.5
  17. Q17 (SA, 3 marks): 10
  18. Q18 (MSQ, 1 marks): A, C
  19. Q19 (MCQ, 2 marks): A
  20. Q20 (MSQ, 2 marks): A, C
  21. Q21 (MCQ, 2 marks): D
  22. Q22 (MSQ, 2 marks): B, D
  23. Q23 (SA, 1 marks): 72
  24. Q24 (SA, 1 marks): 0.97 to 0.99
  25. Q25 (SA, 1 marks): 0.81 to 0.83
  26. Q26 (SA, 3 marks): 4.1 to 4.3

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


1. Core Topics & Concepts

A. Model Training & Evaluation

Key Concepts:

  1. Cross-Validation (K-Fold)

    • Splits data into k folds, trains k times (each fold as validation once).
    • Equation:

      • Inertia (for clustering): ∑i=1nmin⁡μj∈C(∣∣xi−μj∣∣2)\sum_{i=1}^{n} \min_{\mu_j \in C} (||x_i - \mu_j||^2)
      • R2R^2-score: 1−∑(yi−y^i)2∑(yi−yˉ)21 - \frac{\sum (y_i - \hat{y}_i)^2}{\sum (y_i - \bar{y})^2}
    • Example: 10-fold CV trains 10 models (Q2).
  1. Model Persistence (warm_start)

    • Retains weights between .fit() calls (e.g., Perceptron(warm_start=True)) (Q3).
  1. Confusion Matrix

    • Structure: | True\Pred | 0 | 1 | |-----------|---------|---------| | 0 | TN | FP | | 1 | FN | TP |
    • Metrics:

      • Precision: TPTP+FP\frac{TP}{TP + FP}
      • Recall: TPTP+FN\frac{TP}{TP + FN}
      • F1: 2×Precision×RecallPrecision+Recall2 \times \frac{Precision \times Recall}{Precision + Recall}
    • Use Case: Imbalanced data (e.g., rare disease detection) (Q15).
  1. Evaluation Metrics for Imbalanced Data

    • Avoid: Accuracy (misleading for rare classes).
    • Use: Precision, Recall, F1, ROC-AUC (Q15).

B. Preprocessing & Feature Engineering

  1. Image Processing

    • Resize: (1280, 1920, 3) → (200, 200) (grayscale).
    • Flatten: (200, 200) → (40000,) (Q5).
    • Equation: Flattened shape = height×width×channels\text{height} \times \text{width} \times \text{channels}.
  1. Text Vectorization (TF-IDF)

    • TF-IDF: TF-IDF(t,d)=TF(t,d)×IDF(t)\text{TF-IDF}(t, d) = \text{TF}(t, d) \times \text{IDF}(t)
    • Sparsity: Most entries = 0 (Q18).
  1. Handling Missing Data

    • df.dropna(subset=["col1", "col2"], how="all") (drops rows where both are NaN) (Q20).
    • Imputation: SimpleImputer(strategy="most_frequent") (Q12).
  1. Feature Scaling

    • MinMaxScaler: Xscaled=X−Xmin⁡Xmax⁡−Xmin⁡X_{\text{scaled}} = \frac{X - X_{\min}}{X_{\max} - X_{\min}} (scales to [0, 1]) (Q12).

C. Algorithms & Hyperparameters

  1. Linear Models

    • SGDRegressor:

      • Loss functions: 'huber', 'squared_error' (Q8, Q22).
      • Learning rate: 'adaptive' (reduces LR if loss plateaus) (Q14).
    • Logistic Regression:

      • Elastic-net: L1+L2L1 + L2 regularization (Q9).
      • Solver: 'saga' (supports elastic-net).
  1. Neural Networks (MLP)

    • Hyperparameters:

      MLPClassifier(
          hidden_layer_sizes=(128, 64),  # 2 hidden layers
          activation="relu",
          solver="adam",
          alpha=1e-4,  # L2 regularization
          learning_rate_init=0.001,
          max_iter=300
      )
    • Equation: Output = σ(W2⋅ReLU(W1⋅X+b1)+b2)\sigma(W_2 \cdot \text{ReLU}(W_1 \cdot X + b_1) + b_2) (Q6).
  1. Clustering (K-Means)

    • Elbow Method: Plot inertia vs. kk; choose kk at the "elbow" (Q16).
    • Inertia: Sum of squared distances to centroids.
  1. Time Series

    • ADF Test:

      • Null hypothesis: Time series is non-stationary (Q7).
      • Interpretation: p<0.05p < 0.05 → stationary.
    • Decomposition:

      • Multiplicative: Yt=Trend×Seasonality×ErrorY_t = \text{Trend} \times \text{Seasonality} \times \text{Error} (Q11).
  1. Collaborative Filtering

    • Cosine Similarity: similarity(u,v)=u⋅v∣∣u∣∣⋅∣∣v∣∣\text{similarity}(u, v) = \frac{u \cdot v}{||u|| \cdot ||v||}
    • Prediction: Weighted average of similar users' ratings (Q25–27).

D. Scikit-Learn Utilities

  1. Pipelines

    • Caching: memory="path/to/cache" avoids recomputing transformations (Q13).
    • Example:

      Pipeline([
          ("imputer", SimpleImputer(strategy="most_frequent")),
          ("scaler", MinMaxScaler())
      ])
  1. Grid Search

    • Total Models: Product of hyperparameter options (Q24).

      • Example: 3 (n_estimators) × 4 (loss) × 3 (max_depth) = 36 models.
    • Scoring Metrics:

      • Regression: 'neg_mean_squared_error', 'r2'.
      • Classification: 'f1', 'roc_auc' (Q23).

Graph 2: Preprocessing Workflow

Graph 3: Algorithm Selection

Graph 4: Time Series Analysis

Graph 5: Collaborative Filtering


3. Key Equations

ConceptEquation
R² Score1−∑(yi−y^i)2∑(yi−yˉ)21 - \frac{\sum (y_i - \hat{y}_i)^2}{\sum (y_i - \bar{y})^2}
Inertia (K-Means)∑i=1nmin⁡μj∈C(∣∣xi−μj∣∣2)\sum_{i=1}^{n} \min_{\mu_j \in C} (||x_i - \mu_j||^2)
TF-IDFTF-IDF(t,d)=TF(t,d)×log⁡(NDF(t))\text{TF-IDF}(t, d) = \text{TF}(t, d) \times \log(\frac{N}{\text{DF}(t)})
Cosine Similarityu⋅v∣∣u∣∣⋅∣∣v∣∣\frac{u \cdot v}{||u|| \cdot ||v||}
Elastic-Net Penaltyλ1∣∣w∣∣1+λ2∣∣w∣∣22\lambda_1 ||w||_1 + \lambda_2 ||w||_2^2
ADF Test NullH0H_0: Time series is non-stationary

4. Exam Tips

  1. Cross-Validation: Always count models as n_splits (Q2).
  2. Imbalanced Data: Avoid accuracy; use precision/recall/F1 (Q15).
  3. Hyperparameter Tuning: Total models = product of options (Q24).
  4. Text/Image Data: Flattening → (height × width × channels,) (Q5).
  5. Time Series: ADF p<0.05p < 0.05 → stationary (Q7).
  6. Collaborative Filtering: Cosine similarity for user-user predictions (Q25–27).