Complete the code to create a simple linear regression model using scikit-learn.
from sklearn.linear_model import [1] model = [1]()
The LinearRegression class is used to create regression models that predict continuous values.
Complete the code to fit the regression model on training data.
model.fit(X_train, [1])The fit method trains the model using input features X_train and target values y_train.
Fix the error in the code to predict continuous values using the trained model.
predictions = model.[1](X_test)predict_proba which is for classification probabilities.fit again instead of predicting.The predict method returns continuous predicted values for regression models.
Fill both blanks to calculate the mean squared error (MSE) for regression predictions.
from sklearn.metrics import [1] mse = [2](y_test, predictions)
mean_squared_error is the correct metric to measure error for continuous predictions in regression.
Fill all three blanks to create a dictionary of predictions for each test sample with their true values.
results = [1](zip([2], [3]))
Using dict with zip(y_test, predictions) pairs true values with predicted values in a dictionary.
