Quiz Space

MLP Quiz 2: 1 December 2024 (September 2024 term)

Question 1

+3 marksOne correct option

Consider the following code for Ridge Regression:

python
from sklearn.linear_model import Ridge
import numpy as np
X = np.array([[1, 2], [2, 4], [3, 6], [4, 8]])
y = np.array([1, 2, 3, 4])
model = Ridge(alpha=10)
model.fit(X, y)
coefficients = model.coef_
print(np.round(coefficients,2))

What will be the output for the coefficients?

  1. A
  2. B
  3. C
  4. D
  5. E

Question 2

+3 marksOne correct option

Consider the following code for Stochastic Gradient Descent (SGD) Classifier:

python
from sklearn.linear_model import SGDClassifier
from sklearn.datasets import make_classification
X_train, y_train = make_classification(n_samples=1000, n_features=20,
n_classes=2, random_state=42)
model = SGDClassifier(penalty='elasticnet', l1_ratio=0.5, alpha=0.01)
model.fit(X_train, y_train)

What is the significance of l1_ratio=0.5l1\_ratio = 0.5 in this context?

  1. A

    It assigns equal weightage to L1 and L2 regularizations.

  2. B

    It applies only L2 regularization.

  3. C

    It applies only L1 regularization.

  4. D

    It disables regularization completely.

Question 3

+3 marksOne correct option

Given the following code for Polynomial Regression:

python
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
import numpy as np
X = np.array([1, 2, 3, 4, 5]).reshape(-1, 1)
y = np.array([1, 4, 9, 16, 25])
poly = PolynomialFeatures(degree=2, interaction_only=False)
X_poly = poly.fit_transform(X)
model = LinearRegression()
model.fit(X_poly, y)
y_pred = model.predict(X_poly)
print(y_pred)

What will be the output of the code?

  1. A
  2. B
  3. C
  4. D

18 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the MLP Quiz 2 1 Dec 2024 paper

The IIT Madras BS Machine Learning Practice (MLP) Quiz 2 paper sat on 1 Dec 2024, in the September 2024 term: 21 questions for 50 marks in 120 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureMLP Quiz 2 1 Dec 2024 at a glance
TermSeptember 2024 term
SubjectMachine Learning Practice
Course codeBSCS2008
Questions21
Marks50
Duration120 min
MCQ13
MSQ4
Numerical4
Official paperIIT M DIPLOMA AN EXAM QDD2 01 Dec 2024
Negative markingNo negative marking.
Updated

Same Quiz 2, other subjects

More MLP