ML Study Hub

Home / Past papers / MLP End Term / this paper

IIT M FOUNDATION DIPLOMA AN EXAM - 01 Sep 2024

MLP End Term37 questions100 marks19 MCQ · 13 MSQ · 5 SAFoundation / Diploma / afternoon
Elapsed 00:00
Comprehension passage - the questions below it refer to this
Consider the following common data and answer the subquestion: question figure Consider the following common data and answer the subquestion:
Q1MSQ2 marksselect all that apply
Consider the following code snippet: question figure Consider the following code snippet: Which of the following will be equivalent to the above code snippet?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
Q2SA2 marks
What is the output of the following code snippet: question figure What is the output of the following code snippet: Enter -1, if you think the above statement will generate an error.
Q3SA2 marks
What is the output of the following code snippet: question figure What is the output of the following code snippet: Enter -1, if you think the above statement will generate an error.
Q4SA2 marks
What is the output of the following code snippet: question figure What is the output of the following code snippet: Enter -1, if you think the above statement will generate an error.
Q5MCQ2 marks
What is the output of the following code snippet: question figure What is the output of the following code snippet: Choose correct options from following:
  1. The number of rows will decrease in the dataset.
  2. The number of columns will decrease in the dataset.
  3. The number of columns and number of rows, both, will decrease in thedataset.
  4. There will be no change.
  5. Insufficient information.
Q6MCQ2 marks
To load datasets from openml.org, which method will be appropriate?
  1. load_openml()
  2. read_openl()
  3. read_data()
  4. fetch_openml()
  5. load_data()
  6. load_csv()
  7. fetch_csv()
Q7MCQ2 marks
In which of the option given below data preprocessing is required?
  1. In some columns which has values between 0 and 1.
  2. A column contains entity names such as ‘Chennai’, ‘CHENNAI’ and ‘MADRAS’.
  3. The data has only numbers in all the columns.
Q8MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q9MCQ2 marks
Which of the following scikit-learn classes is best suited for examining how the number of samples impacts training and testing errors?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q10MCQ2 marks
Consider following two statements: Statement 1: The GaussianNB classifier can incrementally learn using partial_fit. Statement 2: GaussianNB performance suffers when features are dependent, as it assumes independence in calculating conditional probabilities.
  1. Both statements are True
  2. Only statement 1 is True
  3. Only statement 2 is True
  4. Both statements are False
Q11MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q12MCQ2 marks
Which of the following is true for a hard margin SVM algorithm ?
  1. It does not create hyperplanes as a decision boundary
  2. It will correctly classify all the data point if the data is linearly separable
  3. It is robust to outliers
  4. It is mostly used for clustering the data
Q13MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q14MCQ2 marks
Decision Trees are prone to:
  1. Low bias, low variance
  2. High bias, low variance
  3. Low bias, high variance
  4. High bias, high variance
Q15MCQ3 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
Q16MCQ3 marks
question figure
  1. ‘l1’, ‘l2’
  2. ‘l1’, None
  3. ‘l2’, ‘l1’
  4. ‘l2’, None
Q17MCQ3 marks
question figure
  1. True
  2. False
  3. Yes
  4. No
  5. None of these
Q18MCQ3 marks
question figure
  1. It controls the number of weak learners.
  2. It shrinks the contribution of each classifier.
  3. It sets the weight of each weak learner.
  4. It adjusts the speed at which the model learns.
Q19MCQ4 marks
question figure
  1. Output score is likely to increase.
  2. Output score is likely to decrease.
  3. Output score may increase or decrease.
  4. Output score will remain the same.
Q20MCQ4 marks
question figure
  1. 20
  2. 75
  3. 8
  4. 15
  5. 40
Q21MCQ4 marks
question figure
  1. The final predictions are based on the majority vote.
  2. The final predictions are based on the average of probabilities predicted byeach classifier.
  3. The final predictions are based on the weighted sum of the predictions.
  4. The final predictions are based on the classifier with the highest accuracy.
Q22MCQ4 marks
question figure
  1. The mean accuracy across all cross-validation folds.
  2. The mean precision across all cross-validation folds.
  3. The mean recall across all cross-validation folds.
  4. The mean F1 score across all cross-validation folds.
Q23MCQ4 marks
question figure
  1. Plotting the sum of the squared distances of samples to their closest clustercenter
  2. by Changing the distance metric for KMeans
  3. By initialising clustering centroids very far from each other
  4. All of these
Q24MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q25MSQ2 marksselect all that apply
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q26MSQ2 marksselect all that apply
Which of the following is a hyper parameter?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q27MSQ2 marksselect all that apply
Which of the following models are inherently multiclass models?
  1. Perceptron
  2. DecisionTreeClassifier
  3. KNeighborClassifier
  4. LogisticRegression
Q28MSQ2 marksselect all that apply
Which of the following class(es) is/are used to instantiate a neural network in Sklearn.
  1. SGDClassifier()
  2. MLPClassifier()
  3. NNClassifier()
  4. MLPRegressor()
Q29MSQ3 marksselect all that apply
Which of the following is correct?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q30MSQ3 marksselect all that apply
Which of the following processes can be done if we have a dataset with imbalanced target class distribution?
  1. Remove all the minority classes
  2. Up-sample the minority classes
  3. Remove all the majority classes
  4. Down-sample the majority classes
  5. create synthetic samples to balance the classes
Q31MSQ3 marksselect all that apply
Which of the following is true about Naive Bayes algorithm ?
  1. It is primarily used for regression problems
  2. It is primarily used for classification problems
  3. Hyperparameter tuning is required
  4. Hyperparameter tuning is not required
Q32MSQ3 marksselect all that apply
Which of the following is/are correct regarding RadiusNeighborsClassifier
  1. Only 5 neighbours in the range of some radius are used to compute the labelof a sample.
  2. All the neighbours in the range of some radius are used to compute the labelof a sample.
  3. It is sensitive to outliers.
  4. It is not sensitive to outliers.
Q33MSQ3 marksselect all that apply
question figure
  1. Data is continuously being generated
  2. Data is generated every month
  3. Whole data is generated and its in a huge file size
  4. For very small dataset
Q34MSQ4 marksselect all that apply
question figure
  1. The neural network contains 3 hidden layers with 5 neurons in each hiddenlayer
  2. The neural network contains 5 hidden layers with 3 neurons in each hiddenlayer
  3. The neural network contains 2 hidden layers with 3 neurons in the secondhidden layer
  4. The neural network contains 2 hidden layers with 5 neurons in the first hiddenlayer
  5. All of the given options are correct
Q35MSQ5 marksselect all that apply
question figure
  1. Number of samples at node N = 15. If it is split, it will result in 9 samples in theleft child node and 6 sample in the right child node.
  2. Number of samples at node N = 5. If it is split, it will result in 4 samples in theleft child node and 2 samples in the right child node.
  3. Number of samples at node N = 12. If it is split, it will result in 3 samples in theleft child node and 9 samples in the right child node.
  4. Number of samples at node N = 7. If it is split, it will result in 4 samples in theleft child node and 3 samples in the right child node.
Q36SA2 marks
question figure
Q37SA4 marks
question figure

Answer key

  1. Q1 (MSQ, 2 marks): A, C
  2. Q2 (SA, 2 marks): 120
  3. Q3 (SA, 2 marks): 3
  4. Q4 (SA, 2 marks): -1
  5. Q5 (MCQ, 2 marks): A
  6. Q6 (MCQ, 2 marks): D
  7. Q7 (MCQ, 2 marks): B
  8. Q8 (MCQ, 2 marks): B
  9. Q9 (MCQ, 2 marks): D
  10. Q10 (MCQ, 2 marks): A
  11. Q11 (MCQ, 2 marks): C
  12. Q12 (MCQ, 2 marks): B
  13. Q13 (MCQ, 2 marks): B
  14. Q14 (MCQ, 2 marks): C
  15. Q15 (MCQ, 3 marks): E
  16. Q16 (MCQ, 3 marks): A
  17. Q17 (MCQ, 3 marks): A
  18. Q18 (MCQ, 3 marks): B
  19. Q19 (MCQ, 4 marks): A
  20. Q20 (MCQ, 4 marks): D
  21. Q21 (MCQ, 4 marks): B
  22. Q22 (MCQ, 4 marks): A
  23. Q23 (MCQ, 4 marks): A
  24. Q24 (MSQ, 2 marks): A, D
  25. Q25 (MSQ, 2 marks): A, D
  26. Q26 (MSQ, 2 marks): B, C, D
  27. Q27 (MSQ, 2 marks): B, C
  28. Q28 (MSQ, 2 marks): B, D
  29. Q29 (MSQ, 3 marks): A, D
  30. Q30 (MSQ, 3 marks): B, D, E
  31. Q31 (MSQ, 3 marks): B, D
  32. Q32 (MSQ, 3 marks): B, D
  33. Q33 (MSQ, 3 marks): A, B, C
  34. Q34 (MSQ, 4 marks): C, D
  35. Q35 (MSQ, 5 marks): A, D
  36. Q36 (SA, 2 marks): 0.319 to 0.328
  37. Q37 (SA, 4 marks): 180

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, 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. Pandas & Data Manipulation

B. Scikit-Learn Workflow

C. Models & Algorithms

  1. Linear Models:

    • SGDRegressor/Classifier:

      • loss='log_loss' (logistic regression), loss='hinge' (SVM), loss='perceptron' (Q30).
      • penalty='l1', 'l2', or 'elasticnet' for regularization (Q17).
      • partial_fit for online learning (Q34).
    • Polynomial Features:

      • PolynomialFeatures(degree=2) in pipelines (Q16).
  2. Tree-Based Models:

    • Decision Trees:

      • Prone to high variance/low bias (overfitting) (Q15).
      • Hyperparameters: max_depth, min_samples_split, min_samples_leaf (Q20, Q36).
    • Random Forest/Bagging:

      • BaggingClassifier with DecisionTreeClassifier as base estimator (Q23).
  3. Naive Bayes:

    • Assumes feature independence; suffers with dependent features (Q11).
    • No hyperparameter tuning typically required (Q32).
  4. Neural Networks:

    • MLPClassifier/MLPRegressor for multi-layer perceptrons (Q29, Q35).
    • hidden_layer_sizes=(5,3) defines 2 hidden layers (5 and 3 neurons) (Q35).
  5. Clustering:

    • K-Means:

      • Inertia (sum of squared distances) → 0 when n_clusters = n_samples (Q38).
      • Elbow method: Plot inertia vs. n_clusters (Q24).
  6. Ensemble Methods:

    • Voting Classifier:

      • voting='soft' averages predicted probabilities (Q22).
    • AdaBoost:

      • learning_rate controls weak learner contributions (Q19).
    • Radius Neighbors:

      • Uses all neighbors within a radius (unlike KNN’s fixed k) (Q33).
  7. Imbalanced Data:

    • Strategies: Upsampling minority, downsampling majority, or synthetic samples (SMOTE) (Q31).

D. Evaluation Metrics

E. Text Processing

F. Model-Specific Notes



2. Key Equations (Math-Focused)

A. Linear Models

  1. SGD Update Rule:
wt+1=wt−η⋅∇J(wt)w_{t+1} = w_t - \eta \cdot \nabla J(w_t)
  1. Regularization (L1/L2):

    • L1 (Lasso):
Penalty=α∑∣wi∣\text{Penalty} = \alpha \sum |w_i|
Penalty=α∑wi2\text{Penalty} = \alpha \sum w_i^2
Penalty=α(ρ∑∣wi∣+1−ρ2∑wi2)\text{Penalty} = \alpha \left( \rho \sum |w_i| + \frac{1-\rho}{2} \sum w_i^2 \right)

B. Decision Trees

  1. Gini Impurity:
G=1−∑pi2G = 1 - \sum p_i^2
  1. Entropy:
H=−∑pilog⁡2piH = -\sum p_i \log_2 p_i

C. K-Means

  1. Inertia (Objective Function):
Inertia=∑i=1nmin⁡μj∈C∣∣xi−μj∣∣2\text{Inertia} = \sum_{i=1}^n \min_{\mu_j \in C} ||x_i - \mu_j||^2

D. Evaluation Metrics

  1. Mean Absolute Error (MAE):
MAE=1n∑∣yi−y^i∣\text{MAE} = \frac{1}{n} \sum |y_i - \hat{y}_i|
  1. R² Score:
R2=1−∑(yi−y^i)2∑(yi−yˉ)2R^2 = 1 - \frac{\sum (y_i - \hat{y}_i)^2}{\sum (y_i - \bar{y})^2}

E. Naive Bayes

  1. Conditional Probability (Gaussian NB):
P(xi∣y)=12πσy2exp⁡(−(xi−μy)22σy2)P(x_i | y) = \frac{1}{\sqrt{2\pi\sigma_y^2}} \exp\left(-\frac{(x_i - \mu_y)^2}{2\sigma_y^2}\right)


Graph 2: Model Relationships

Graph 3: Data Preprocessing

Graph 4: Model Evaluation

Graph 5: Hyperparameter Tuning



4. Exam Tips

  1. Pandas:

    • loc vs. iloc: loc uses labels, iloc uses integer positions.
    • dropna() affects rows by default (not columns unless axis=1).
  2. Scikit-Learn:

    • Pipelines: Use make_pipeline to chain transforms and estimators.
    • Partial Fit: For online learning (e.g., SGDRegressor.partial_fit).
    • Voting: voting='soft' averages probabilities; 'hard' uses majority vote.
  3. Math:

    • Know when inertia = 0 in K-Means (n_clusters = n_samples).
    • Understand how learning_rate affects AdaBoost (shrinks contributions).
  4. Code Snippets:

    • Memorize common patterns (e.g., KFold output, CountVectorizer vocabulary).
  5. Hyperparameters:

    • max_depth, n_neighbors, degree are hyperparameters (not intercept_).

Good luck! Focus on practical coding patterns, math behind algorithms, and scikit-learn’s API.