Quiz Space

Machine Learning Practice · Quiz 1 · 16 Jul 2023 · May 2023 term

Question 24: Consider the following code: Which of the following is m…

Question 24

+3 marksOne correct option

Consider the following code:

python
import numpy as np
from sklearn.linear_model import LinearRegression
X = np.array([[1, 1], [1, 2], [2, 2], [2, 3], [2, 1], [3, 3]])
# y = 1 * x_0 + 2 * x_1 + 3
y = np.dot(X, np.array([1, 2])) + 3
reg1 = LinearRegression(fit_intercept = False).fit(X, y)
s1 = reg1.score(X, y)
reg2 = LinearRegression(fit_intercept = True).fit(X, y)
s2 = reg2.score(X, y)

Which of the following is more likely to be true?

  1. A

    s1 = s2

  2. B

    s1 < s2

  3. C

    s1 > s2

Show answer

Correct answer

  • B

    s1 < s2

Question 24 of 24 in the IIT Madras BS Machine Learning Practice (MLP) Quiz 1 paper sat on 16 Jul 2023, in the May 2023 term (IIT M DIPLOMA AN2 EXAM QPD2 16 JULY 2023). It carries 3 marks.

More questions from this paper

  1. Q1Which of the following things can be observed from a Histogram ?
  2. Q2Which of the following are use cases of ColumnTransformer?
  3. Q3Consider a regression dataset, the features are "Temperature" and "Humidity", and the label is "Precipitation" (i.e. ra…
  4. Q4Which of the following options is/are correct?
  5. Q5Figure question
  6. Q6For the below code which option will provide the samples(rows) containing outliers according to the standard Boxplot in…
  7. Q7What will be the output of the following code snippet ?
  8. Q8What will be the output of the following code ?
  9. Q9Which of the following is(are) true statements?\ Statement 1: A dataset is splitted into the train set and the test set…
  10. Q10Figure question
  11. Q11Consider the following code: Which metrics will be contained in score1 and score2 respectively?
  12. Q12Suppose you have a trained stochastic gradient regressor model by enabling warm start parameter. What happens if you ca…
  13. Q13What is the purpose of the tol parameter in the fit method of the stochastic regressor?
  14. Q14Figure question
  15. Q15How many models with different combinations of parameter values will get trained in the following code?
  16. Q16Figure question
  17. Q17To see the distribution of the data along each numerical feature which of the following codes will show all the histogr…
  18. Q18Which of the following can affect performance of the Simple linear Regression while training the model?
  19. Q19Figure question
  20. Q20Consider the following code block: Which of the following may be appropriate to be filled in the blank space?
  21. Q21Which of the following are correct statements?
  22. Q22Figure question
  23. Q23Consider the following code: Which of the following may be the correct output of the above code?: