Question 12
Suppose you have a trained stochastic gradient regressor model by enabling warm start parameter. What happens if you call the fit method again with the same model instance and different training data?
from sklearn.linear_model import SGDRegressor
model = SGDRegressor(warm_start=True)
X_train = [[0, 0], [1, 1]]y_train = [0, 1]model.fit(X_train, y_train)
# Call fit() again with different training dataX_train_new = [[2, 2], [3, 3]]y_train_new = [2, 3]model.fit(X_train_new, y_train_new)The new training data is ignored, and the model continues training from the previously learned weights.
The new training data is used to update the model weights, but the previous weights are discarded.
An error is raised, indicating that the model has already been trained.
The model weights are reset, and the model begins training again from scratch.