awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.64k stars 755 forks source link

metric mase #3137

Open moghadas76 opened 8 months ago

moghadas76 commented 8 months ago

Hi,

Are MASE and MAE(in the literature) metric are consistent?

def mase( target: np.ndarray, forecast: np.ndarray, seasonal_error: float, ) -> float: r""" .. math:: mase = mean(|Y - \hat{Y}|) / seasonal\_error See [HA21]_ for more details. """ return np.mean(np.abs(target - forecast)) / seasonal_error

My implementation for MAE:

def mae( target: np.ndarray, forecast: np.ndarray, seasonal_error: float, ) -> float: r""" .. math:: mase = mean(|Y - \hat{Y}|) See [HA21]_ for more details. """ return np.mean(np.abs(target - forecast))