ML Study Hub

Home / Past papers / MLP Quiz 1 / this paper

IIT M QUIZ 1 FOUNDATION DAD DIPLOMA QPE2 16 Oct 2022 - 16 Oct 2022

MLP Quiz 121 questions50 marks19 MCQ · 1 MSQ · 1 SAFoundation / Diploma / QPE2
Elapsed 00:00
Q1MCQ0 marks
question figure
  1. YES
  2. NO
Q2MCQ1 mark
Which of the following options represent the possible type of machine learning algorithm does the cluster plot shown in Figure 2 demonstrate? question figure Which of the following options represent the possible type of machine learning algorithm does the cluster plot shown in Figure 2 demonstrate?
  1. K-means clustering
  2. Linear regression
  3. Logistic regression
  4. PCA
Q3MCQ2 marks
What will be the output of the following code? question figure What will be the output of the following code?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q4MCQ2 marks
Which of the following code blocks will generate a random n-class classification problem having a total number of features as 5 and 3 unique labels in the target variable?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q5MCQ2 marks
Go through the code snippet given below: question figure Go through the code snippet given below: What will be the shape of the feature matrix (X.shape) and the label vector (y.shape)?
  1. (2000, 28) and (2000, 1)
  2. (28, 2000) and (1505,1)
  3. (500, 7) and (500,)
  4. (2000, 7) and (1505,)
Q6MCQ2 marks
Which of the following options is likely to be the correct output of the code snippet given below? question figure Which of the following options is likely to be the correct output of the code snippet given below?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q7MCQ2 marks
Consider the following code snippet: question figure Consider the following code snippet: Above code returns (178, 13) as output. Which of the following would be the correct code(s) to split X and y such that you have exactly 36 samples for test data?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q8MCQ2 marks
In the figure 1, what are the names of classes arranged in the decreasing order of the median values? question figure In the figure 1, what are the names of classes arranged in the decreasing order of the median values?
  1. First > Second > Third
  2. Third > Second > First
  3. Second < Third < First
  4. Third > First > Second
Q9MCQ2 marks
Which of the following is likely to be the correct output of the code given below? question figure Which of the following is likely to be the correct output of the code given below?
  1. 0.12
  2. 190.31
  3. 0.93
  4. 90.02
  5. No evaluation metrics is mentioned, hence it will produce error
Q10MCQ3 marks
Which of the following is likely to be the correct output of the code given below? question figure Which of the following is likely to be the correct output of the code given below?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q11MCQ3 marks
Consider the following code snippet: question figure Consider the following code snippet: Which of the following could be the correct output?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q12MCQ3 marks
Which of the following options will be the correct output of print(clf.coef_)? question figure Which of the following options will be the correct output of print(clf.coef_)?
  1. [ 0.35 -0. -0. ]
  2. [-0.85,0]
  3. [3,2,1,2]
  4. Given code block will return an error.
Q13MCQ3 marks
Go through the code snippet given below and mark the correct output. question figure Go through the code snippet given below and mark the correct output.
  1. 1
  2. 3.5
  3. 5
  4. 25
  5. 4
  6. 12.75
Q14MCQ3 marks
Go through the code snippet given below and mark the correct output. question figure Go through the code snippet given below and mark the correct output.
  1. 0.61
  2. 0.83
  3. 0.91
  4. 1
  5. -3
  6. 2
Q15MCQ3 marks
Which of the following is likely to be the correct output of the code given below? question figure Which of the following is likely to be the correct output of the code given below?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q16MCQ3 marks
Which of the following code blocks will correctly take the learning rate as ‘invscaling’ ?
  1. question figure
  2. question figure
  3. question figure
  4. question figure
Q17MCQ3 marks
Go through the code snippet given below and answer the following questions. question figure Go through the code snippet given below and answer the following questions. Which of the following could be the possible output of print(results.alpha_)?
  1. -0.528
  2. -5
  3. 0.528
  4. 1.e-03
  5. 0.01
Q18MSQ3 marksselect all that apply
Scikit-Learn’s API is remarkably well designed. The main design principles are:-
  1. Nonproliferation of classes
  2. Best Estimator
  3. Proportion
  4. Consistency
Q19SA2 marks
Enter the correct output of the following code block. question figure Enter the correct output of the following code block.
Comprehension passage - the questions below it refer to this
Go through the code snippet given below and answer the given subquestions. question figure Go through the code snippet given below and answer the given subquestions.
Q20MCQ3 marks
Which of the following options will be the output of the given code?
  1. array([ 0.02645639, -0.09121131, 0.09350173, 0.11821129])
  2. [-0.05102706 0.11483443 -0.01544466 0.04813268 0.05634579]
  3. array([-0.22622766, -0.0, -0.0])
  4. Given code will return an error because the data-set is not given.
Q21MCQ3 marks
Which of the following could be the possible output of print(reg.score())?
  1. -0.528
  2. 1
  3. 0.528
  4. Given code will return an error

Answer key

  1. Q1 (MCQ, 0 marks): A
  2. Q2 (MCQ, 1 marks): A
  3. Q3 (MCQ, 2 marks): B
  4. Q4 (MCQ, 2 marks): C
  5. Q5 (MCQ, 2 marks): C
  6. Q6 (MCQ, 2 marks): D
  7. Q7 (MCQ, 2 marks): C
  8. Q8 (MCQ, 2 marks): A
  9. Q9 (MCQ, 2 marks): D
  10. Q10 (MCQ, 3 marks): C
  11. Q11 (MCQ, 3 marks): A
  12. Q12 (MCQ, 3 marks): D
  13. Q13 (MCQ, 3 marks): F
  14. Q14 (MCQ, 3 marks): E
  15. Q15 (MCQ, 3 marks): A
  16. Q16 (MCQ, 3 marks): C
  17. Q17 (MCQ, 3 marks): E
  18. Q18 (MSQ, 3 marks): A, D
  19. Q19 (SA, 2 marks): 8
  20. Q20 (MCQ, 3 marks): B
  21. Q21 (MCQ, 3 marks): D

Concepts this paper tests

Auto-generated summary from the source site. Handy as a checklist; the lessons above explain each idea from scratch.

Summary of Core Topics, Concepts, Principles, and Equations

Machine Learning Concepts

  1. Supervised vs. Unsupervised Learning

    • Supervised Learning: Algorithms that learn from labeled data (e.g., linear regression, logistic regression).
    • Unsupervised Learning: Algorithms that learn from unlabeled data (e.g., K-means clustering).
  1. Clustering Algorithms

    • K-means Clustering: Partitions data into k clusters based on feature similarity.
    • Equation: Minimize the within-cluster sum of squares (WCSS).
  1. Regression Algorithms

    • Linear Regression: Models the relationship between a dependent variable and one or more independent variables.

      • Equation: y=β0+β1x1+β2x2+…+βnxn+ϵy = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \ldots + \beta_n x_n + \epsilon
    • Logistic Regression: Used for binary classification.

      • Equation: log⁡(p1−p)=β0+β1x1+β2x2+…+βnxn\log\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \ldots + \beta_n x_n
  1. Dimensionality Reduction

    • Principal Component Analysis (PCA): Reduces the dimensionality of data while preserving variance.

      • Equation: XPCA=X⋅WX_{PCA} = X \cdot W, where WW is the matrix of eigenvectors.
  1. Model Evaluation Metrics

    • Mean Squared Error (MSE): Measures the average squared difference between predicted and actual values.

      • Equation: MSE=1n∑i=1n(yi−y^i)2MSE = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2
    • R-squared (R²): Measures the proportion of variance in the dependent variable that is predictable from the independent variables.

      • Equation: R2=1−∑i=1n(yi−y^i)2∑i=1n(yi−yˉ)2R^2 = 1 - \frac{\sum_{i=1}^{n} (y_i - \hat{y}_i)^2}{\sum_{i=1}^{n} (y_i - \bar{y})^2}
  1. Data Preprocessing

    • Scaling: Standardizing or normalizing features.

      • Standard Scaling: x′=x−μσx' = \frac{x - \mu}{\sigma}
      • Min-Max Scaling: x′=x−min⁡(X)max⁡(X)−min⁡(X)x' = \frac{x - \min(X)}{\max(X) - \min(X)}
    • Imputation: Handling missing data.

      • Mean Imputation: Replace missing values with the mean of the feature.
  1. Polynomial Features

    • PolynomialFeatures: Generates polynomial and interaction features.

      • Equation: For degree=2, [1,x1,x2,x12,x1x2,x22][1, x_1, x_2, x_1^2, x_1 x_2, x_2^2]
  1. Cross-Validation

    • K-Fold Cross-Validation: Splits data into k folds and trains the model on k-1 folds, validating on the remaining fold.
    • Equation: Average performance across all folds.
  1. Regularization

    • Ridge Regression: Adds L2 regularization to linear regression.

      • Equation: min⁡w∥Xw−y∥22+α∥w∥22\min_{w} \|Xw - y\|_2^2 + \alpha \|w\|_2^2
    • Lasso Regression: Adds L1 regularization to linear regression.

      • Equation: min⁡w∥Xw−y∥22+α∥w∥1\min_{w} \|Xw - y\|_2^2 + \alpha \|w\|_1
  1. Stochastic Gradient Descent (SGD)

    • SGDRegressor: Uses stochastic gradient descent to fit linear models.

      • Equation: w=w−η∇Qi(w)w = w - \eta \nabla Q_i(w), where η\eta is the learning rate.

Software Engineering Concepts

  1. Scikit-Learn API

    • Design Principles: Consistency, nonproliferation of classes, best estimator.
    • Pipeline: Combines multiple steps into a single object.

      • Example: Pipeline([("poly", PolynomialFeatures(degree=2)), ("feature_scaling", MinMaxScaler())])
  1. Data Splitting

    • train_test_split: Splits data into training and testing sets.

      • Example: train_test_split(X, y, test_size=0.2, random_state=42)
  1. One-Hot Encoding

    • OneHotEncoder: Converts categorical features into a one-hot encoded format.

      • Example: OneHotEncoder(handle_unknown='ignore')

Mathematical Concepts

  1. Linear Algebra

    • Matrix Operations: Essential for understanding transformations and feature scaling.
    • Eigenvalues and Eigenvectors: Important for PCA.
  1. Probability and Statistics

    • Mean, Variance, and Standard Deviation: Fundamental for data preprocessing and evaluation metrics.
    • Normal Distribution: Basis for many statistical methods and assumptions in machine learning.