Symmetric Mean Absolute Percentage Error

class pycast.errors.symmetricmeanabsolutepercentageerror.SymmetricMeanAbsolutePercentageError(minimalErrorCalculationPercentage=60)[source]

Bases: pycast.errors.baseerrormeasure.BaseErrorMeasure

Implements the symmetric mean absolute percentage error whose values are between 0 and 200%.

Explanation: http://www.stat.iastate.edu/preprint/articles/2004-10.pdf (page 14)

If the calculated value and the original value are equal, the error is 0.

_calculate(startingPercentage, endPercentage, startDate, endDate)[source]

This is the error calculation function that gets called by BaseErrorMeasure.get_error().

Both parameters will be correct at this time.

Parameters:
  • startingPercentage (float) – Defines the start of the interval. This has to be a value in [0.0, 100.0]. It represents the value, where the error calculation should be started. 25.0 for example means that the first 25% of all calculated errors will be ignored.
  • endPercentage (float) – Defines the end of the interval. This has to be a value in [0.0, 100.0]. It represents the value, after which all error values will be ignored. 90.0 for example means that the last 10% of all local errors will be ignored.
  • startDate (float) – Epoch representing the start date used for error calculation.
  • endDate (float) – Epoch representing the end date used in the error calculation.
Returns:

Returns a float representing the error.

Return type:

float

local_error(originalValue, calculatedValue)[source]

Calculates the error between the two given values.

Parameters:
  • originalValue (list) – List containing the values of the original data.
  • calculatedValue (list) – List containing the values of the calculated TimeSeries that corresponds to originalValue.
Returns:

Returns the error measure of the two given values.

Return type:

numeric

Previous topic

Median Absolute Percentage Error

Next topic

Custom Error Measures

This Page