RAPAE
timecave.validation_strategy_metrics.RAPAE(estimated_error, test_error)
Compute the Relative Absolute Predictive Accuracy Error (RAPAE).
This function computes the RAPAE 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
|
Relative Absolute Predictive Accuracy Error. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
See also
PAE: Predictive Accuracy Error.
APAE: Absolute Predictive Accuracy Error.
RPAE: Relative Predictive Accuracy Error.
sMPAE: Symmetric Mean Predictive Accuracy Error.
Notes
The Relative Absolute Predictive Accuracy Error is defined as the Absolute Predictive Accuracy Error (APAE) divided by the model's true error. It can also be seen as the absolute value of the Relative Predictive Accuracy Error (RPAE):
This metric essentially takes the absolute value of the RPAE, and can be used in a similar fashion. However, since it uses the absolute value, it cannot be used to determine whether a validation method is overestimating or underestimating the model's true error. Like the RPAE, it is an asymmetric measure.
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 RAPAE
>>> RAPAE(15, 5)
2.0
>>> RAPAE(1, 5)
0.8
>>> RAPAE(8, 8)
0.0
If the true error is zero, the metric is undefined:
>>> RAPAE(5, 0)
Traceback (most recent call last):
...
ValueError: The test error is zero. RAPAE is undefined.
Source code in timecave/validation_strategy_metrics.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |