sMPAE
timecave.validation_strategy_metrics.sMPAE(estimated_error, test_error)
Compute the symmetric Mean Predictive Accuracy Error (sMPAE).
This function computes the sMPAE metric. Both the estimated (i.e. validation) error and the test error must be passed as parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
estimated_error |
float | int
|
Validation error. |
required |
test_error |
float | int
|
True (i.e. test) error. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Symmetric Mean Predictive Accuracy Error. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
See also
PAE: Predictive Accuracy Error.
APAE: Absolute Predictive Accuracy Error.
RPAE: Relative Predictive Accuracy Error.
RAPAE: Relative Absolute Predictive Accuracy Error.
Notes
The symmetric Mean Predictive Accuracy Error is obtained by dividing the Predictive Accuracy Error (PAE) by half the sum of the absolute values of both the error estimate and the true error:
Similarly to the Relative Predictive Accuracy Error (RPAE), this metric can be seen as a scaled version of the PAE. Unlike the RPAE, however, the sMPAE is symmetric, as all possible values lie in the interval of \([-2, 2]\). If the error estimate is equal to the true error (perfect estimation), the sMPAE is zero. Since this metric is based on the PAE, the sign retains its significance (negative sign for underestimation, positive sign for overestimation).
Note that, in all likelihood, the true error will not be known. It is usually estimated using an independent test set.
Examples:
>>> from timecave.validation_strategy_metrics import sMPAE
>>> sMPAE(3, 2)
0.4
>>> sMPAE(3, 5)
-0.5
>>> sMPAE(5, 5)
0.0
>>> sMPAE(5, 0)
2.0
>>> sMPAE(0, 5)
-2.0
If both the true error and the estimated error are zero, this metric is undefined:
Source code in timecave/validation_strategy_metrics.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |