evaluator_cache#

The compiled-evaluator cache a fitted MMM keeps for its incrementality questions.

A fitted MMM owns one EvaluatorCache. Every Incrementality object it creates leases compiled CounterfactualEvaluator objects from it, so repeated questions over the same graph and data compile once. The model creates and clears the cache itself; a user does not call it directly.

Functions

constant_data_fingerprint(idata)

Return a content fingerprint of a DataTree's fit-time constant_data.

Classes

EvaluatorCache([max_entries])

Bounded LRU cache of compiled counterfactual evaluators.

EvaluatorCacheKey(response_vars, ...)

Identity of a compiled counterfactual evaluator.

EvaluatorLease(cache, key, evaluator, *, cached)

One request's hold on a compiled evaluator, taken out of the cache.