mixle.task.recommend module

Decision-oriented model recommendation for heterogeneous data samples.

recommend_model wraps mixle.utils.automatic.analyze_structure() and returns an object a program can inspect, store, and optionally fit. The recommendation includes:

  • the selected estimator;

  • per-field family choices, runner-up families, and bit-scale confidence gaps;

  • low-confidence fields where more data or domain review would sharpen the choice;

  • pairwise dependencies that support modeling fields jointly; and

  • profile warnings that should be reviewed before production use.

Pass fit=True to attach a fitted model to the returned recommendation.

class FieldChoice(path, kind, family, runner_up, gap_bits)[source]

Bases: object

The family chosen for one field, the runner-up, and how decisive the choice was (bits/obs).

Parameters:
property confident: bool

Confident when the family is type-determined (no real contender) or clears the runner-up by a margin.

class ModelRecommendation(estimator, fields, dependencies, warnings, profile=None)[source]

Bases: object

A model shape recommended from data: estimator, per-field choices+confidence, dependencies, and notes.

Parameters:
low_confidence_fields()[source]

Fields whose family choice is not yet decisive – where more data would most sharpen the model.

Return type:

list[FieldChoice]

fit(data, **kwargs)[source]

Fit the recommended estimator on data and return the model.

Parameters:
Return type:

Any

explain()[source]

Plain-language lines: the underlying profile’s explanation (families, bits, dependencies, warnings).

Return type:

list[str]

recommend_model(data, *, fit=False, **analyze_kwargs)[source]

Recommend a model shape for data (and optionally fit it); see ModelRecommendation.

analyze_kwargs pass through to mixle.utils.automatic.analyze_structure() (sampling, pairwise budget, validation). With fit=True the returned recommendation’s estimator is also fit and the model is attached as .model.

Parameters:
Return type:

ModelRecommendation