nnf_smape: Symmetric mean absolute percentage error

View source: R/metrics.R

nnf_smapeR Documentation

Symmetric mean absolute percentage error

Description

Symmetric mean absolute percentage error

Usage

nnf_smape(input, target)

Arguments

input

(torch_tensor) A tensor of actual values

target

(torch_tensor) A tensor with the same shape as the input

Details

Computed according to the formula:

SMAPE = \frac{1}{n}\displaystyle∑_{t=1}^{n} \frac{≤ft\|input - target\right\|}{(≤ft\|target\right\| + ≤ft\|input\right\|) *0.5}

See Also

yardstick::smape

Examples

input <- c(92, 6.5, 57.69, 15.9, 88.47, 75.01, 5.06, 45.95, 27.8, 70.96)
input <- as_tensor(input)

target <- c(91.54, 5.87, 58.85, 10.73, 81.47, 75.39, 2.05, 40.95, 27.34, 66.61)
target <- as_tensor(target)

nnf_smape(input, target)


krzjoa/torchts documentation built on June 24, 2022, 5:30 a.m.