Quiz Space

Machine Learning Practice · Quiz 2 · 4 Aug 2024 · May 2024 term

Question 1: Given the following code for Polynomial Regression: What …

Question 1

+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)
print(model.coef_)

What are the coefficients of the model?

  1. A

    [0, 1, 1]

  2. B

    [0, 2, 1]

  3. C

    [0, 0, 1]

  4. D

    [0, 0, 2]

Show answer

Correct answer

  • C

    [0, 0, 1]

Question 1 of 22 in the IIT Madras BS Machine Learning Practice (MLP) Quiz 2 paper sat on 4 Aug 2024, in the May 2024 term (IIT M DIPLOMA AN EXAM QDD2 4 Aug 2024). It carries 3 marks.

More questions from this paper

  1. Q2What is ‘naive’ assumption in classifiers based on Naive Bayes?
  2. Q3Figure question
  3. Q4What is the effect of increasing the regularization parameter alpha in Ridge Regression?
  4. Q5Given the code below: What do the coefficients represents?
  5. Q6How can we use both Ridge and Lasso Regularization in a machine learning model?
  6. Q7Which of the following types of classification problems is being solved when a model predicts multiple labels(greater t…
  7. Q8Given the code snippet and assume if any necessary requirements: What does cv=5 signify in this context?
  8. Q9Consider the following code and assume all the imports being made: What does the score method compute in this context?
  9. Q10Given the following code snippet for a multi-label classification problem: What does MultiOutputClassifier do in this c…
  10. Q11What is the main advantage of using RandomizedSearchCV over GridSearchCV ?
  11. Q12Figure question
  12. Q13What type of classification problem is the Perceptron algorithm best suited for?
  13. Q14What will be the output of the following code? Given that output of iris.target_names is ['setosa', 'versicolor', 'virg…
  14. Q15What is the default loss value in SGDClassifier API and it gives which classifier?
  15. Q16You are working with a dataset containing 1000 samples, aiming to classify them using the KNeighborsClassifier from sci…
  16. Q17Figure question
  17. Q18What will be the output of the following code ?
  18. Q19Figure question
  19. Q20Figure question
  20. Q21Which of the following scikit-learn model supports incremental learning through partial_fit method ?
  21. Q22Which of the following options are true for regularization parameter C in sklearn.svm.SVC ?