Problem 1: Calculate All Four Regression Metrics
Easypython
Learn the Concept: Regression Metrics (MAE, MSE, RMSE, R²)Problem Description
Write a Python program that calculates MAE, MSE, RMSE, and R² for a set of actual and predicted values using Scikit-learn.
Input
Two lists: actual values and predicted values.
Output
All four calculated metrics.
Constraints
- Both lists must have the same length.
Example Input
textactual=[100,150,200,250], predicted=[110,140,210,240]
Example Output
textMAE: 10.0 MSE: 100.0 RMSE: 10.0 R² Score: 0.98...
Concepts Covered
mean_absolute_error(), mean_squared_error(), r2_score(), np.sqrt().
Related Problems
- Problem 2: Manually Calculate MAE and MSEEasy · pythonSolve Problem
- Problem 3: Compare MAE and RMSE with an OutlierEasy · pythonSolve Problem
- Problem 4: Calculate R² for a Trained Regression ModelEasy · pythonSolve Problem