How good is a forecast? Three numbers answer it from different angles:
Implement regression_metrics(y_true, y_pred) returning a dict with keys "mae", "rmse" and "r2".
If every y_true value is the same, the denominator is zero: return 1.0 if the predictions are also perfect, otherwise 0.0. Raise ValueError if the inputs have different lengths or are empty.