Quiz Space

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

Question 3: What is the purpose of the tol parameter in the fit metho…

Question 3

+2 marksOne correct option

What is the purpose of the tol parameter in the fit method of the stochastic regressor?

python
from sklearn.linear_model import SGDRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.datasets import load_breast_cancer
X,y = load_breast_cancer(return_X_y=True)
model = SGDRegressor(early_stopping=True,
validation_fraction=0.2,
tol=0.001,
n_iter_no_change=5)
X_train, X_test, y_train, y_test = train_test_split(X, y,
test_size=0.2,
random_state=42)
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
mse = mean_squared_error(y_test, y_pred)
  1. A

    It specifies the tolerance level for early stopping based on the change in the validation error.

  2. B

    It controls the learning rate of the stochastic regressor during training.

  3. C

    It determines the maximum number of iterations for the training process.

  4. D

    It defines the fraction of the validation set used for early stopping.

Show answer

Correct answer

  • A

    It specifies the tolerance level for early stopping based on the change in the validation error.

Question 3 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 2 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. Q4Suppose we want to transform features in a dataset using polynomial transformation. The sklearn API provides the functi…
  4. Q5For a dataset with 1000 data points and 100 features, the following code will generate how many models during execution…
  5. Q6Consider the following code: Which of the following is more likely to be true?
  6. Q7Given the following code snippet, which statement is true regarding the use of LabelEncoder?
  7. Q8Which of the following Evaluation metrics can be used in a regression problem?
  8. Q9Figure question
  9. Q10For LinearRegression with equation Y = W_0X_0+W_1X_1+W_2X_2 and given that W_2 = 2W_1. What will be the value of the W_…
  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.