mixle.task.recommend module¶
recommend_model – point a regular program at a data sample and get back a model shape, with confidence.
The other local task Grant named: “help recommend a model shape from the data.” mixle already auto-selects
structure (mixle.utils.automatic.analyze_structure() scores candidate families per field by description
length); this wraps that into a decision-oriented answer a program can act on:
the recommended estimator (ready to
fit),per field, the chosen family, the runner-up, and the bit-gap between them – how confident the choice is (a wide gap = clearly this family; a narrow gap = the data can’t yet tell them apart),
the fields whose choice is low-confidence – exactly where collecting more data would pay off (the “better data collection” lever),
the pairwise dependencies that argue for modeling fields jointly rather than independently.
No teacher, no GPU – this is mixle’s generative model selection exposed as a one-call advisor. fit=True
also returns the fitted model.
- class FieldChoice(path, kind, family, runner_up, gap_bits)[source]
Bases:
objectThe family chosen for one field, the runner-up, and how decisive the choice was (bits/obs).
- path: str
- kind: str
- family: str
- 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:
objectA model shape recommended from data: estimator, per-field choices+confidence, dependencies, and notes.
- Parameters:
- estimator: Any
- fields: list[FieldChoice]
- profile: Any = None
- 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
dataand return the model.
- recommend_model(data, *, fit=False, **analyze_kwargs)[source]
Recommend a model shape for
data(and optionally fit it); seeModelRecommendation.analyze_kwargspass through tomixle.utils.automatic.analyze_structure()(sampling, pairwise budget, validation). Withfit=Truethe returned recommendation’sestimatoris also fit and the model is attached as.model.