0
0
ML Pythonprogramming~10 mins

Why regression predicts continuous values in ML Python - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
ADecisionTreeClassifier
BLogisticRegression
CKNeighborsClassifier
DLinearRegression
Attempts:
3 left
2fill in blank
medium

Complete 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'
Ay_train
BX_test
Cy_test
DX_train
Attempts:
3 left
3fill in blank
hard

Fix 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'
Apredict
Bpredict_proba
Cscore
Dfit
Attempts:
3 left
4fill in blank
hard

Fill 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'
Amean_squared_error
Baccuracy_score
Cconfusion_matrix
Droc_auc_score
Attempts:
3 left
5fill in blank
hard

Fill 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'
Adict
By_test
Cpredictions
Dlist
Attempts:
3 left