Avoids recomputing expensive diagnostics by hashing their inputs and reusing stored results.
Arguments
- test_name
Character scalar naming the diagnostic registered in
.diagnostic_registryor.test_factory.- model
Fitted model object supplied to the diagnostic.
- data
Data frame used to fit the model.
- ...
Additional arguments forwarded to the diagnostic.
- use_cache
Logical scalar indicating whether cached results may be used (defaults to
TRUE).
Details
The cache key is created by hashing the test name, model coefficients,
residuals, data, and additional arguments. When the key already exists in the
cache environment the stored result is returned immediately; otherwise the
diagnostic is executed and its output stored for future calls. Set
use_cache = FALSE to force recomputation when the underlying model has
changed.
See also
clearTestCache() resets the cache between analysis sessions.