Fork me on GitHub

src/arraymancer/ml/metrics/common_error_functions

  Source Edit

Procs

proc absolute_error[T: SomeFloat](y, y_true: T | Complex[T]): T {.inline.}
Absolute error for a single value, |y_true - y|   Source Edit
proc absolute_error[T: SomeFloat](y, y_true: Tensor[T] | Tensor[Complex[T]]): Tensor[
    T] {.noinit.}
Element-wise absolute error for a tensor   Source Edit
proc mean_absolute_error[T: SomeFloat](y, y_true: Tensor[T] | Tensor[Complex[T]]): T
Also known as L1 loss, absolute error between elements: sum(|y_true - y|)/m where m is the number of elements   Source Edit
proc mean_relative_error[T: SomeFloat](y, y_true: Tensor[T] | Tensor[Complex[T]]): T
Mean relative error for Tensor, mean of the element-wise |y_true - y|/max(|y_true|, |y|) Normally the relative error is defined as |y_true - y| / |y_true|, but here max is used to make it symmetric and to prevent dividing by zero, guaranteed to return zero in the case when both values are zero.   Source Edit
proc mean_squared_error[T: SomeFloat](y, y_true: Tensor[T] | Tensor[Complex[T]]): T
Also known as MSE or L2 loss, mean squared error between elements: sum(|y_true - y| ^2)/m where m is the number of elements   Source Edit
proc relative_error[T: SomeFloat](y, y_true: T | Complex[T]): T {.inline.}
Relative error, |y_true - y|/max(|y_true|, |y|) Normally the relative error is defined as |y_true - y| / |y_true|, but here max is used to make it symmetric and to prevent dividing by zero, guaranteed to return zero in the case when both values are zero.   Source Edit
proc relative_error[T: SomeFloat](y, y_true: Tensor[T] | Tensor[Complex[T]]): Tensor[
    T] {.noinit.}
Relative error for Tensor, element-wise |y_true - x|/max(|y_true|, |x|) Normally the relative error is defined as |y_true - x| / |y_true|, but here max is used to make it symmetric and to prevent dividing by zero, guaranteed to return zero in the case when both values are zero.   Source Edit
proc squared_error[T: SomeFloat](y, y_true: Complex[T]): T {.inline.}
Squared error for a single value, |y_true - y| ^2   Source Edit
proc squared_error[T: SomeFloat](y, y_true: T): T {.inline.}
Squared error for a single value, |y_true - y| ^2   Source Edit
proc squared_error[T: SomeFloat](y, y_true: Tensor[T] | Tensor[Complex[T]]): Tensor[
    T] {.noinit.}
Element-wise squared error for a tensor, |y_true - y| ^2   Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood