ML Study Hub

Home / Past papers / MLP End Term / this paper

IIT M FOUNDATION DIPLOMA FN EXAM - 01 Sep 2024

MLP End Term37 questions100 marks20 MCQ · 11 SA · 6 MSQFoundation / Diploma / forenoon
Elapsed 00:00
Comprehension passage - the questions below it refer to this
Consider following common data and answer the subquestions: question figure Consider following common data and answer the subquestions:
Q1SA2 marks
What will be the output of the following code snippet? question figure What will be the output of the following code snippet? Enter -1, if you think the above code snippet will generate an error.
Q2SA2 marks
What will be the output of the following code snippet? question figure What will be the output of the following code snippet? Enter -1, if you think the above code snippet will generate an error.
Q3SA2 marks
What will be the output of the following code snippet? question figure What will be the output of the following code snippet? Enter -1, if you think the above code snippet will generate an error.
Q4SA2 marks
How many columns have datatype as ”float64”?
Q5SA2 marks
What will be the output of the following code snippet? question figure What will be the output of the following code snippet? Enter -1, if you think the above code snippet will generate an error.
Q6SA2 marks
Consider following parameter grid for regression with RandomForest: question figure Consider following parameter grid for regression with RandomForest: How many unique combinations of hyperparameters are there in the above parameter grid?
Q7MCQ1 mark
How to make SGDRegressor stop after 1000 epochs?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q8MCQ2 marks
question figure
  1. DictVectorizer
  2. HashingVectorizer
  3. FeatureHasher
Q9MCQ2 marks
Which of the following is an example of an ordinal variable?
  1. Blood type (A, B, AB, O)
  2. Satisfaction rating (Very Unsatisfied, Unsatisfied, Neutral, Satisfied, VerySatisfied)
  3. Height of individuals
  4. Gender
Q10MCQ2 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q11MCQ2 marks
question figure
  1. cv
  2. reg_rate
  3. alpha
  4. tol
Q12MCQ3 marks
question figure
  1. 1000
  2. 100
  3. 99
  4. 999
Q13MCQ3 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q14MCQ3 marks
question figure
  1. It determines whether to include a bias term in the model.
  2. It sets the degree of the polynomial features.
  3. It controls the regularization strength.
  4. It specifies the number of features to consider when fitting the model.
Q15MCQ3 marks
question figure
  1. To specify the maximum number of samples per leaf.
  2. To limit the depth of the tree.
  3. To set the minimum number of samples required to split an internal node.
  4. To control the minimum impurity decrease required for a split.
Q16MCQ3 marks
question figure
  1. It determines the function to measure the quality of a split.
  2. It specifies the number of features to consider when looking for the best split.
  3. It sets the strategy used to choose the split at each node.
  4. It controls whether to use the Gini impurity or entropy.
Q17MCQ3 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q18MCQ3 marks
Consider below statements and choose the correct option: Statement1:The bagging technique combines multiple models trained on different subsets of data Statement2:The Boosting technique trains the model Parallelly, focusing on the error made by the other model.
  1. Statement1 is True, Statement2 is True
  2. Statement1 is True, Statement2 is False
  3. Statement1 is False, Statement2 is True
  4. Statement1 is False, Statement2 is False
Q19MCQ3 marks
How does agglomerative clustering handle outliers?
  1. It ignores outliers during the clustering process.
  2. It assigns outliers to the nearest cluster.
  3. It creates separate clusters for outliers.
  4. It removes outliers from the dataset before clustering.
Q20MCQ3 marks
What is agglomerative clustering?
  1. A hierarchical clustering technique that starts with each data point as itscluster and merges the closest clusters iteratively.
  2. A method for partitioning data into a predefined number of clusters.
  3. A clustering algorithm that uses centroids to iteratively assign data points toclusters.
  4. A dimensionality reduction technique that projects data onto a lower-dimensional space.
Q21MCQ3 marks
question figure
  1. The distance between cluster centroids
  2. The number of clusters formed
  3. The within-cluster sum of squared distances
  4. The silhouette coefficient
Q22MCQ4 marks
Consider the following ML task/steps for a regression dataset: 1. Read the data from a file (named ‘dataset.csv’). It has 7 columns. The last column is the target variable, all 6 features numerical. 2. Remove rows which has target values missing. 3. Split the data into training and test sets. Take randomly the 70% of rows in the training set and the rest of them into the test set. 4. Fill the missing values in the features by KNNImputer using 3 nearest neighbours. 5. Train a LinearRegression model on the training set. 6. Report R2 score on the test set. Which of the following code snippets correctly accomplishes the above task? Assume necessary imports.
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
  6. question figure
Q23MCQ4 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q24MCQ4 marks
question figure
  1. question figure
  2. question figure
  3. question figure
  4. question figure
  5. question figure
Q25MCQ4 marks
question figure
  1. The predictions are based on the majority vote.
  2. The predictions are based on the average of probabilities predicted by eachclassifier.
  3. The predictions are based on the weighted sum of the predictions.
  4. The predictions are based on the classifier with the highest accuracy
Q26MCQ4 marks
question figure
  1. 5 centroids are randomly initialized 10 times
  2. 10 centroids are randomly initialized 5 times
  3. 5 samples in the dataset are selected as initialization point such that they areat least 10 units away from each other
  4. 10 samples in the dataset are selected as initialization point such that they areat least 5 units away from each other
Q27MSQ2 marksselect all that apply
Data snooping:
  1. Leads to biased estimation on test sets
  2. Increases the risk of false positives
  3. Leads to better estimation on training sets
  4. Reduces the risk of false positives
Q28MSQ2 marksselect all that apply
Which of the following algorithms may get impacted by feature scaling?
  1. LinearRegression
  2. DecisionTree
  3. SVM
  4. NaiveBayes
Q29MSQ3 marksselect all that apply
question figure
  1. The logistic regression model will use equal weights for both the classes in animbalanced dataset.
  2. The model does not use any regularization because the parameter C is set.
  3. The “balanced” mode uses the values of y to automatically adjust weightsinversely proportional to class frequencies in the input data.
  4. The value of C indicates that the model will apply a regularization.
Q30MSQ3 marksselect all that apply
Which of the following statements are true?
  1. KNeighborsClassifier with high values of n_neighbors produces complexdecision boundaries.
  2. KNeighborsClassifier with high values of n_neighbors produces smoothdecision boundaries.
  3. In KNeighborsClassifier the scale of the features(columns) can impact thedecision boundaries.
  4. None of these
Q31MSQ3 marksselect all that apply
Which options are correct for Support Vectors in SVM ?
  1. Support vectors are the data points nearest to the hyperplane
  2. Using these support vectors, we maximize the margin of the classifier.
  3. Using these support vectors, we minimize the margin of the classifier.
  4. None of these
Q32MSQ3 marksselect all that apply
Which of the following are correct for Kmeans clustering algorithm?
  1. It only finds spherical clusters.
  2. The output of the algorithms depends upon initial cluster centroids.
  3. It can automatically detect most appropriate value of k.
  4. None of these.
Q33SA3 marks
question figure
Q34SA3 marks
question figure
Q35SA3 marks
question figure
Comprehension passage - the questions below it refer to this
Based on the above data, answer the given subquestions. question figure
Q36SA2 marks
What will be the output of the following code? question figure What will be the output of the following code?
Q37SA2 marks
What will be the output of the following code? question figure What will be the output of the following code?

Answer key

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

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). The exam covers Pandas, Scikit-Learn, ML algorithms, hyperparameter tuning, evaluation metrics, and clustering. Key areas are grouped into theoretical concepts, practical coding skills, and mathematical foundations (where applicable).


1. Core Topics & Concepts

A. Data Handling with Pandas

Non-missing values=(rows×columns)−sum of missing values\text{Non-missing values} = (\text{rows} \times \text{columns}) - \text{sum of missing values}
Mean=∑i=1nxicount of non-NaN values\text{Mean} = \frac{\sum_{i=1}^{n} x_i}{\text{count of non-NaN values}}

B. Machine Learning Algorithms

1. Supervised Learning

Loss=MSE+α∑i=1nwi2\text{Loss} = \text{MSE} + \alpha \sum_{i=1}^{n} w_i^2
Loss=MSE+α∑i=1n∣wi∣\text{Loss} = \text{MSE} + \alpha \sum_{i=1}^{n} |w_i|
y^=sign(wTx+b)\hat{y} = \text{sign}(w^T x + b)

2. Unsupervised Learning

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

3. Ensemble Methods

C. Model Evaluation

D. Preprocessing

E. Hyperparameter Tuning

F. Bias-Variance Tradeoff

G. Data Leakage & Best Practices


2. Key Equations

ConceptEquation
Linear Regressiony^=wTx+b\hat{y} = w^T x + b
Ridge RegressionLoss=MSE+α∑wi2\text{Loss} = \text{MSE} + \alpha \sum w_i^2
Lasso RegressionLoss=MSE+α∑∣wi∣\text{Loss} = \text{MSE} + \alpha \sum |w_i|
Logistic RegressionP(y=1)=11+e−(wTx+b)P(y=1) = \frac{1}{1 + e^{-(w^T x + b)}}
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}}
R² Score1−SSresSStot1 - \frac{\text{SS}_{\text{res}}}{\text{SS}_{\text{tot}}}
Inertia (K-Means)∑i=1nmin⁡μj∣∣xi−μj∣∣2\sum_{i=1}^{n} \min_{\mu_j} ||x_i - \mu_j||^2
Gini Impurity1−∑i=1Cpi21 - \sum_{i=1}^{C} p_i^2
Entropy−∑i=1Cpilog⁡(pi)-\sum_{i=1}^{C} p_i \log(p_i)
Euclidean Distance∑i=1n(xi−yi)2\sqrt{\sum_{i=1}^{n} (x_i - y_i)^2}

Graph 2: Unsupervised Learning

Graph 3: Model Evaluation

Graph 4: Preprocessing & Feature Engineering

Graph 5: Ensemble Methods

Graph 6: Hyperparameter Tuning


4. Exam Tips

  1. Pandas:

    • Know how to count non-missing values (df.shape[0]*df.shape[1] - df.isna().sum().sum()).
    • Use value_counts() for categorical data.
  2. Scikit-Learn:

    • Syntax: model.fit(X_train, y_train), model.predict(X_test).
    • Pipelines: Ensure preprocessing is only fitted on training data.
  3. Algorithms:

    • Decision Trees: max_depth controls overfitting.
    • Random Forest: n_estimators = number of trees.
    • KNN: Scale features; n_neighbors affects boundaries.
  4. Evaluation:

    • Precision/Recall Tradeoff: High precision = fewer FP; high recall = fewer FN.
    • Cross-Validation: LOOCV generates n models for n samples.
  5. Clustering:

    • K-Means: Inertia measures compactness.
    • Agglomerative: Assigns outliers to nearest clusters.
  6. Hyperparameters:

    • Ridge/Lasso: alpha controls regularization strength.
    • SGD: max_iter = epochs.