mixle.utils.automatic.detectors package¶
Detector registry for automatic model selection.
A Detector describes one candidate distribution family for the profiler / get_estimator:
when it applies (a support gate over the data), its BIC code length on the data (for selection), how
to build its estimator, and (optionally) its CDF for goodness-of-fit. Families register here so the
candidate set can be extended without editing the core profiling/selection code – every module in this
package self-registers on import, and the registry is discovered lazily the first time it is queried.
This is purely additive: the profiler’s built-in candidates (gaussian / student_t / mixture / lognormal / gamma for continuous; poisson / categorical for integer) are unchanged; registered detectors are scored and built alongside them, so a richer family only ever wins when its BIC actually beats the builtins.
A detector receives the data two ways, matching the leaf profiler:
* applies(arr) and score(arr, nobs) and cdf(arr) take the expanded value array (a NumPy array
of the observed scalars, repeated by their counts);
factory(vdict, pseudo_count, emp_suff_stat, use_bstats)takes the value->count map and returns aParameterEstimator– the same signature as the built-inget_*_estimatorfactories.
- class Detector(name, kind, applies, score, factory, cdf=None, n_params=2)[source]
Bases:
objectOne candidate distribution family for automatic selection.
- Parameters:
- name: str
- kind: str
- n_params: int = 2
- register(detector)[source]
Register a detector (idempotent on name within its kind). Returns it, so it can decorate a build.
- Parameters:
detector (Detector)
- Return type:
Detector
- continuous_detectors()[source]
Registered continuous-support candidate families.
- Return type:
list[Detector]
- discrete_detectors()[source]
Registered integer/discrete-support candidate families.
- Return type:
list[Detector]
- get_detector(name)[source]
Return the registered detector with this name (any kind), or None.
- Parameters:
name (str)
- Return type:
Detector | None
Submodules¶
- mixle.utils.automatic.detectors.beta module
- mixle.utils.automatic.detectors.exgaussian module
- mixle.utils.automatic.detectors.generalized_extreme_value module
- mixle.utils.automatic.detectors.generalized_gaussian module
- mixle.utils.automatic.detectors.generalized_pareto module
- mixle.utils.automatic.detectors.gumbel module
- mixle.utils.automatic.detectors.inverse_gaussian module
- mixle.utils.automatic.detectors.laplace module
- mixle.utils.automatic.detectors.logistic module
- mixle.utils.automatic.detectors.negative_binomial module
- mixle.utils.automatic.detectors.pareto module
- mixle.utils.automatic.detectors.skew_normal module
- mixle.utils.automatic.detectors.tweedie module
- mixle.utils.automatic.detectors.weibull module