Library that implements MAE, MSE & RMSE evaluation metrics.
from mae import MAE
mae = MAE(
actual_vals=[12, 13, 14, 15, 15, 22, 27],
predicted_vals=[11, 13, 14, 14, 15, 16, 18],
)
mae.calc_errors()
mae.set_absolute_vals()
mae.sum_errors()
result = mae.get_mean()
assert round(result, 5) == 2.42857
from mse import MSE
mse = MSE(
actual_vals=[34, 37, 44, 47, 48, 48, 46, 43, 32, 27, 26, 24],
predicted_vals=[37, 40, 46, 44, 46, 50, 45, 44, 34, 30, 22, 23],
)
mse.calc_errors()
mse.square_errors()
mse.sum_errors()
result = mse.get_mean()
assert round(result, 5) == 5.91667
from rmse import RMSE
rmse = RMSE(
actual_vals=[34, 37, 44, 47, 48, 48, 46, 43, 32, 27, 26, 24],
predicted_vals=[37, 40, 46, 44, 46, 50, 45, 44, 34, 30, 22, 23],
)
rmse.calc_errors()
rmse.square_errors()
rmse.sum_errors()
rmse.set_mean()
result = rmse.get_square_root()
assert round(result, 5) == 2.43242