Question
Scikit‑learn Estimator Caching ↔ Joblib Memory: When Is Cached Result Invalidated by Code Changes?
Ira Maple
0 reputation · 02 Apr 2024, 20:41 UTC
99K views0
Goal
Determine how changes to an estimator’s implementation affect the persistence of results stored by joblib’s Memory when the estimator is used in GridSearchCV.
Constraints
The cache is keyed by a hash that incorporates the estimator’s class, its arguments, and the import path. Modifying method bodies without altering hyperparameters may still produce the same hash, leading to stale results. Concurrent parallel execution can further obscure staleness detection.
Unresolved Questions
- Does joblib recompute the cache key when only the body of an estimator’s
fitmethod changes? - Can a change in the estimator’s external dependencies (e.g., a utility function it imports) trigger a cache invalidation without clearing the base directory?
- What is the impact of running
GridSearchCVwithn_jobs>1on cache consistency when the estimator code changes between parallel jobs?