Concepts

Model lifecycle and package surface

mixle centers on distribution objects, estimator objects, and capabilities exposed by fitted models. Use this page as the conceptual reference before moving into code examples.

Core idea

Declare structure once.

A model shape is declared as a probability object or matching estimator. Leaves compose into records, mixtures, HMMs, grammars, and task models. Fitting, scoring, sampling, serialization, and enumeration follow that structure instead of requiring unrelated APIs.

DistributionProbability object used for density, sampling, encoding, and fitted artifacts.
EstimatorMatching object that accumulates sufficient statistics and returns a fitted distribution.
CapabilityObjects advertise support for fitting, density, sampling, enumeration, explanation, and persistence.

Lifecycle

From declaration to artifact.

1

Distribution

Declare the probability object: Gaussian, categorical, mixture, HMM, composite record, grammar, or custom family.

2

Estimator

Fit the same structure by closed form, EM, MAP, hierarchical, state-space, VI, MCMC, or an explicit route.

3

Encoder

Keep heterogeneous fields in a structured representation instead of forcing every workflow through one flat matrix.

4

Enumerator

For discrete structured models, walk support in probability order and ask rank or seek questions directly.

5

Artifact

Evaluate, explain, calibrate, save, restore, and serve the fitted object without switching abstractions.

Scope

Where it fits.

mixle is not meant to replace every numerical, Bayesian, or machine-learning library. It is most useful when model structure is part of the problem.

Suitable

  • Mixed records with numeric, categorical, sequence, set, tree, or missing fields.
  • Mixtures, HMMs, grammars, Bayesian leaves, or tied parameters in one model.
  • Local task models distilled from LLM, human, or rule-based teachers.
  • Physics inverse problems in mixle-pde and serving workflows in mixle-mlops.
  • Discrete structured models where top-k, rank, seek, or support enumeration matter.

Usually not first choice

  • Plain single-table supervised learning already covered by scikit-learn.
  • Pure large-scale tensor training where JAX or PyTorch is the whole abstraction.
  • Production Bayesian regression workflows that need Stan/PyMC-level sampler maturity today.
  • One-off scripts where a few SciPy calls are clearer than a model object.

Extras

Optional dependency groups.

numbaJIT hot paths
torchGPU and autograd engine
jaxXLA and NumPyro backend
sparkdistributed estimation
daskcluster execution
mpiparallel runs
datapandas, Arrow, SQL, Mongo, Hadoop
sympysymbolic export
umapmodel-based embeddings

Package facts

Project metadata.

The public package uses the PyPI distribution name mixle and the import name mixle. The source repository, docs, examples, and issue tracker are open.

Version0.7.0
Python3.10, 3.11, 3.12
StatusBeta
LicenseMIT
Testspytest suite with fast and full gates
Repositorygithub.com/gmboquet/mixle