Question 20
Consider the following code snippet:
import numpy as npfrom sklearn.linear_model import SGDRegressorX = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]])y = np.array([3, 6, 9, 12, 15])
model = SGDRegressor(learning_rate='constant', eta0=0.1, max_iter=1000)model.fit(X, y)What does the learning_rate='constant' parameter in the SGDRegressor() function control?
It adjusts the learning rate based on the number of iterations.
It specifies the learning rate to decrease as the model converges.
It specifies the fraction of the dataset used for each step in the stochastic gradient descent.
It defines the initial value for the learning rate and keeps it constant throughout training.