Quiz Space

Machine Learning Practice · Quiz 1 · 23 Feb 2025 · January 2025 term

Question 10: For LinearRegression with equation Y = W_0X_0+W_1X_1+W_2…

Question 10

+3 marksNumerical answer

For LinearRegression with equation Y=W0X0+W1X1+W2X2Y = W_0X_0+W_1X_1+W_2X_2 and given that W2=2∗W1W_2 = 2*W_1.

What will be the value of the W2W_2 for the below code if the model doesn't make any error?

(Write the answer correct upto one decimal)

Where X1X_1 and X2X_2 are column1 and column2 respectively and W1W_1 and W2W_2 are weights associated to the respected columns while fitting

python
from sklearn.linear_model import LinearRegression
X_train = [[1,2], [2,4], [3,6], [4,8]]
y_train = [1,2,3,4]
reg = LinearRegression(fit_intercept=False) #intercept=0
reg.fit(X_train,y_train)
print(reg.coef_[1])
Show answer

Correct answer: 0.4

Question 10 of 20 in the IIT Madras BS Machine Learning Practice (MLP) Quiz 1 paper sat on 23 Feb 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD2 23 Feb 2025). It carries 3 marks.

More questions from this paper

  1. Q1What is the primary risk of not performing a train-test split in a machine learning workflow?
  2. Q2Why is data preprocessing necessary before using it for model building?
  3. Q3What is the purpose of the tol parameter in the fit method of the stochastic regressor?
  4. Q4Suppose we want to transform features in a dataset using polynomial transformation. The sklearn API provides the functi…
  5. Q5For a dataset with 1000 data points and 100 features, the following code will generate how many models during execution…
  6. Q6Consider the following code: Which of the following is more likely to be true?
  7. Q7Given the following code snippet, which statement is true regarding the use of LabelEncoder?
  8. Q8Which of the following Evaluation metrics can be used in a regression problem?
  9. Q9Figure question
  10. Q11Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df | Age | J…
  11. Q12Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df | Age | J…
  12. Q13Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df | Age | J…
  13. Q14Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df | Age | J…
  14. Q15Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df | Age | J…
  15. Q16Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df | Age | J…
  16. Q17Consider the Following codeblock for the given subquestions. Based on the above data, answer the given subquestions.
  17. Q18Consider the Following codeblock for the given subquestions. Based on the above data, answer the given subquestions.
  18. Q19Consider the Following codeblock for the given subquestions. Based on the above data, answer the given subquestions.
  19. Q20Consider the Following codeblock for the given subquestions. Based on the above data, answer the given subquestions.