reconstuction errorsΒΆ

path orion.primitives.timeseries_errors.reconstruction_errors

description this primitive computes an array of errors comparing reconstructed and expected output. There are three main approaches for computing the discrepancies: point-wise, area, and dtw.

see json.

argument

type

description

parameters

y

numpy.ndarray

ground truth

y_hat

numpy.ndarray

predicted values

hyperparameters

step_size

int

indicates the number of steps between windows in the predicted values

score_window

int

indicates the size of the window over which the scores are calculated

rec_error_type

str

reconstruction error types, can be one of ["point", "area", "dtw"]

smooth

bool

indicates whether the returned errors should be smoothed

smoothing_window

float

size of the smoothing window, expressed as a proportion of the total

output

errors

numpy.ndarray

array of errors

In [1]: import numpy as np

In [2]: from mlstars import load_primitive

In [3]: primitive = load_primitive('orion.primitives.timeseries_errors.reconstruction_errors')

In [4]: y = np.array([[1]] * 100)

In [5]: y_hat = np.array([[.99]] * 100)

In [6]: errors, predictions = primitive.produce(y=y, y_hat=y_hat)

In [7]: print("average error value: {:.2f}".format(errors.mean()))
average error value: 0.01