gtime.metrics.smape

gtime.metrics.smape(y_true:Union[pandas.core.frame.DataFrame, List, numpy.ndarray], y_pred:Union[pandas.core.frame.DataFrame, List, numpy.ndarray]) → float

Compute the ‘Symmetric Mean Absolute Percentage Error’ (SMAPE) between two vectors. Documentation here <https://en.wikipedia.org/wiki/Symmetric_mean_absolute_percentage_error>_.

Parameters
y_truearray-like, shape (length, 1), required

The first vector.

y_predarray-like, shape (length, 1), required

The second vector.

Returns
smapefloat

The smape between the two input vectors.

Examples

>>> from gtime.metrics import smape
>>> y_true = [0, 1, 2, 3, 4, 5]
>>> y_pred = [1.1, 2.3, 0.4, 3.9, 3.1, 4.6]
>>> smape(y_true, y_pred)
0.7864893577539014