Challenge - 5 Problems
Linear Regression Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
Output of simple linear regression prediction
What is the predicted value of y for x = 4 using the model y = 2x + 1?
ML Python
def predict(x): return 2 * x + 1 result = predict(4) print(result)
Attempts:
2 left
❓ Model Choice
intermediate1:30remaining
Choosing the right model for linear data
You have data points that form a straight line. Which model is best to predict new points?
Attempts:
2 left
❓ Metrics
advanced2:00remaining
Interpreting mean squared error (MSE)
If a linear regression model has an MSE of 0.01 on test data, what does this mean?
Attempts:
2 left
🔧 Debug
advanced2:00remaining
Why does this linear regression code fail?
What error will this code produce?
from sklearn.linear_model import LinearRegression
model = LinearRegression()
X = [1, 2, 3, 4]
y = [2, 4, 6, 8]
model.fit(X, y)
ML Python
from sklearn.linear_model import LinearRegression model = LinearRegression() X = [1, 2, 3, 4] y = [2, 4, 6, 8] model.fit(X, y)
Attempts:
2 left
🧠 Conceptual
expert2:00remaining
Effect of learning rate in linear regression training
What happens if the learning rate in gradient descent for linear regression is set too high?
Attempts:
2 left