Skip to content
CampusEduX

Problem 3: Compare MAE and RMSE with an Outlier

Easypython
Learn the Concept: Regression Metrics (MAE, MSE, RMSE, R²)

Problem Description

Write a Python program that calculates MAE and RMSE for a dataset with one significant outlier error, demonstrating how RMSE is affected more strongly than MAE.

Input

Actual and predicted values, where one prediction has a very large error.

Output

MAE and RMSE, showing the difference in sensitivity.

Constraints

  • At least 5 data points, with one clear outlier error.

Example Input

text
actual=[10,20,30,40,50], predicted=[11,19,31,39,100]

Example Output

text
MAE: 11.0 RMSE: 22.65

Concepts Covered

mean_absolute_error(), mean_squared_error(), outlier sensitivity comparison.

Related Problems

  • Problem 1: Calculate All Four Regression Metrics
    Easy · python
    Solve Problem
  • Problem 2: Manually Calculate MAE and MSE
    Easy · python
    Solve Problem
  • Problem 4: Calculate R² for a Trained Regression Model
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...