An open API service indexing awesome lists of open source software.

https://github.com/ansebi/maen


https://github.com/ansebi/maen

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# MAEN
Mean Absolute Error Normalised


Magnitude-invariant universal loss score.

Designed for evaluating the performance of Times Series Forecast models.

Evaluates such problematic cases as Near-Zero and Flat vectors of target values.

Requires min and max reference values.

```
import urllib
urllib.request.urlretrieve(
'https://github.com/Ansebi/maen/blob/main/maen_score.py?raw=true',
'maen_score.py'
)
from maen_score import np, maen_score

'''
y_train = np.random.normal(0, 0.00001, 100)
y_test = np.random.normal(0, 0.00001, 10)
y_pred = np.random.normal(0, 0.00001, 10)
'''
y_train: np.array = ...
y_test: np.array = ...
y_pred: np.array = ...

maen = maen_score(y_test, y_pred, y_train.min(), y_train.max())

[print(i) for i in zip(y_test, y_pred)]
print(f'{maen = :.2f}')
```