MSE stands for Mean Squared Error. It measures the average of the squares of the errors between predicted and actual values.
Click to reveal answer
beginner
How is RMSE different from MSE?
RMSE stands for Root Mean Squared Error. It is the square root of MSE, which brings the error metric back to the original units of the target variable.
Click to reveal answer
beginner
What does the R² score tell us in regression?
R², or coefficient of determination, shows how well the model explains the variation in the data. It typically ranges from 0 to 1, where 1 means perfect prediction, but can be negative if the model fits worse than a horizontal line.
Click to reveal answer
intermediate
Why do we square errors when calculating MSE?
Squaring errors makes all differences positive and penalizes larger errors more than smaller ones, helping to highlight big mistakes.
Click to reveal answer
intermediate
If a regression model has an R² of 0, what does it mean?
An R² of 0 means the model does not explain any of the variation in the target data; it predicts no better than the average value.
Click to reveal answer
Which metric gives error in the same units as the target variable?
ARMSE
BR²
CMSE
DMean Absolute Error
✗ Incorrect
RMSE is the square root of MSE, so it has the same units as the target variable.
What does a higher R² value indicate?
AWorse model fit
BBetter model fit
CMore error
DNo relationship
✗ Incorrect
Higher R² means the model explains more of the data's variation, indicating better fit.
What is the main reason to use MSE instead of just average error?
ATo ignore negative errors
BTo simplify calculations
CTo penalize larger errors more
DTo measure accuracy
✗ Incorrect
MSE squares errors, so bigger mistakes count more, helping to improve model quality.
If RMSE is very high, what does it suggest about the model?
AModel predictions have large errors
BModel predictions are very close to actual values
CModel perfectly fits the data
DModel has no errors
✗ Incorrect
High RMSE means the average prediction error is large, so the model is less accurate.
Which metric can be negative in some cases?
AMean Absolute Error
BRMSE
CMSE
DR²
✗ Incorrect
R² can be negative if the model fits worse than a horizontal line predicting the mean.
Explain in your own words what MSE, RMSE, and R² measure in regression.
Think about error size and how well the model fits the data.
You got /3 concepts.
Why might RMSE be more intuitive to understand than MSE when evaluating a regression model?
Consider the units of measurement and how humans perceive error.
You got /3 concepts.
Practice
(1/5)
1. What does the Mean Squared Error (MSE) measure in regression evaluation?
easy
A. The total number of data points
B. The average of the squared differences between predicted and actual values
C. The correlation between features
D. The percentage of correct predictions
Solution
Step 1: Understand MSE definition
MSE calculates the average of squared differences between predicted and actual values to measure error size.
Step 2: Compare options to definition
Only The average of the squared differences between predicted and actual values correctly describes MSE as average squared error; others describe unrelated concepts.
Final Answer:
The average of the squared differences between predicted and actual values -> Option B
Quick Check:
MSE = average squared error [OK]
Hint: MSE = average squared error between prediction and truth [OK]
Common Mistakes:
Confusing MSE with accuracy
Thinking MSE measures correlation
Mixing MSE with count of data points
2. Which of the following Python code snippets correctly calculates the Root Mean Squared Error (RMSE) given true values y_true and predicted values y_pred?
easy
A. rmse = np.sum((y_true - y_pred)**2)
B. rmse = np.mean(np.abs(y_true - y_pred))
C. import numpy as np
rmse = np.sqrt(np.mean((y_true - y_pred)**2))
D. rmse = np.sqrt(np.sum(y_true - y_pred))
Solution
Step 1: Recall RMSE formula
RMSE is the square root of the mean of squared differences between true and predicted values.
Step 2: Match code to formula
import numpy as np
rmse = np.sqrt(np.mean((y_true - y_pred)**2)) correctly computes squared differences, averages them, then takes square root. Others miss steps or use wrong operations.
Final Answer:
import numpy as np
rmse = np.sqrt(np.mean((y_true - y_pred)**2)) -> Option C
Quick Check:
RMSE = sqrt(mean squared error) [OK]
Hint: RMSE = sqrt of mean squared error, use np.sqrt(np.mean(...)) [OK]
Common Mistakes:
Using sum instead of mean
Taking sqrt before mean
Using absolute difference instead of squared
3. Given the true values y_true = [3, -0.5, 2, 7] and predicted values y_pred = [2.5, 0.0, 2, 8], what is the R² score?
medium
A. 1.0
B. 0.865
C. 0.75
D. 0.948
Solution
Step 1: Calculate R² score formula
R² = 1 - (sum of squared residuals / total sum of squares). Calculate residuals and totals:
A. The subtraction is done element-wise but sum is outside, causing wrong squaring
B. The function should use absolute values instead of squares
C. The length should be squared, not the sum
D. The function is missing import statements
Solution
Step 1: Analyze the code operation order
The code does sum(y_true - y_pred) first, then squares the total sum, which is incorrect for MSE.
Step 2: Correct MSE calculation
MSE requires squaring each difference first, then averaging. The code should square element-wise before summing.
Final Answer:
The subtraction is done element-wise but sum is outside, causing wrong squaring -> Option A
Quick Check:
Square differences before sum for MSE [OK]
Hint: Square each difference before summing for MSE [OK]
Common Mistakes:
Squaring sum instead of sum of squares
Using absolute difference instead of squared
Ignoring element-wise operations
5. You trained two regression models on different datasets. Model A has MSE=4 and R²=0.8, Model B has MSE=2 and R²=0.6. Which model is better and why?
hard
A. Model B is better because it has lower MSE, indicating smaller average error
B. Model A is better because it has higher R², showing better fit to data
C. Both models are equally good because MSE and R² contradict
D. Cannot decide without RMSE values
Solution
Step 1: Understand MSE and R² meanings
MSE measures average squared error (lower is better). R² measures proportion of variance explained (higher is better).
Step 2: Compare models on error and fit
Model B has lower MSE (2 < 4), so predictions are closer on average. Model A has higher R² but larger error, meaning it fits variance better but with bigger errors.
Step 3: Prioritize error for prediction quality
Lower error (MSE) usually means better prediction accuracy, so Model B is better despite lower R².
Final Answer:
Model B is better because it has lower MSE, indicating smaller average error -> Option A
Quick Check:
Lower MSE means better prediction accuracy [OK]
Hint: Lower MSE beats higher R² for prediction accuracy [OK]
Common Mistakes:
Choosing model with higher R² ignoring error size
Thinking MSE and R² always agree
Ignoring what metric matters for task
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.