Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a simple linear regression model using scikit-learn.
ML Python
from sklearn.linear_model import [1] model = [1]()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to fit the regression model on training data.
ML Python
model.fit(X_train, [1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to predict continuous values using the trained model.
ML Python
predictions = model.[1](X_test) Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to calculate the mean squared error (MSE) for regression predictions.
ML Python
from sklearn.metrics import [1] mse = [2](y_test, predictions)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a dictionary of predictions for each test sample with their true values.
ML Python
results = [1](zip([2], [3]))
Drag options to blanks, or click blank then click option'
Attempts:
3 left