Dmx Expert Orchestrator
Use this skill as the top-level router for local modeling requests in
dmx-learn.
Keep the first pass focused on five decisions:
- Is the request local and in scope for
dmx-learn?
- Where is the data, and can it be inspected directly?
- What does one observation look like?
- Does the objective call for ordinary non-Bayesian estimation or for priors,
variational inference, a DPM, or automatic Bayesian model construction?
- Should the first model be a base estimator, composite, or mixture, and which
narrower skill or reference should carry the detailed implementation?
Modeling Surface
- Treat explicit
dmx.stats construction as the default for ordinary
non-Bayesian local modeling.
- Choose
dmx.bstats when the request requires Bayesian priors or expected
log-density behavior, local variational estimation, a truncated
Dirichlet-process mixture (DPM), or automatic construction intended to feed
a Bayesian mixture workflow.
- Treat
get_estimator(data, use_bstats=True) and get_dpm_mixture(data, ...)
from dmx.utils.automatic as first-class local routes for those use cases.
They are deliberate bstats paths, not fallbacks.
- Prefer explicit estimator construction when the non-Bayesian model family is
known. Do not use automatic routing merely to avoid choosing a clear
dmx.stats estimator.
- If the downstream task is not fully fixed, prefer fitting one reusable joint,
composite, or composite-mixture model before narrowing to a task-specific
conditional path.
- For heterogeneous data with unknown latent subtype count, make a DPM over
dmx.bstats.CompositeEstimator components the main high-value Bayesian
route. The composite preserves field semantics while the truncated DPM and
variational optimizer infer a useful finite mixture.
- Mention
torch_stats only when the user's scale or repeated inference needs
make accelerator-backed fitting a plausible next step.
Hard Scope Boundary
- This skill is for local and in-memory modeling workflows.
- Local
dmx.bstats, dmx.bstats.bestimation, and
dmx.utils.automatic workflows are in scope.
- Do not use it for Spark, MPI, cluster scheduling, or other distributed
estimation paths.
- Do not substitute
get_dpm_mixture_mpi, dmx.mpi4py.bstats, or
dmx.mpi4py.utils for the local helpers. Those are separate MPI-specific
workflows even when they operate on the same bstats model types.
- If the user asks for distributed fitting, say it is out of scope and do not
improvise a Spark or MPI workflow.
Routing Workflow
1. Intake
The intake goal is to get the minimum local-data facts needed to choose model
structure from the actual data, not from vague prompt wording.
- Treat the local data path, loader path, or in-memory object as a first-class
input.
- If a data path or loader is available, prefer inspecting a representative
observation instead of asking the user to describe the whole dataset from
memory.
- Ask what one observation looks like in concrete terms: one row, record,
tuple, sequence, or other unit of modeling.
- Ask or infer field roles: continuous, categorical, count, binary, text,
set-like, sequence-like, or optional.
- Ask whether any part of the observation is ordered, variable-length, or
nested.
- Ask whether there are known groups, labels, repeated entities, or candidate
conditioning keys.
- Ask for rough data size, including sample count and typical sequence length
when relevant.
- Ask whether GPU use is acceptable before suggesting
torch_stats.
- Ask whether the user needs explicit priors, variational inference, automatic
model construction, or an unknown number of latent components; any of these
can change the surface choice from
dmx.stats to dmx.bstats.
- Ask whether the user already has a fixed downstream task or just wants a good
reusable fitted model.
Use a concise first-pass intake like this when the answers are not already
available from the supplied data:
- Where is the local data or loader I should inspect?
- What does one observation look like?
- Which fields are continuous, categorical, counts, optional, set-like, or
sequence-like?
- Are there labels, groups, repeated entities, or known conditioning keys?
- Roughly how many observations are there, how long are sequences if any, and
is GPU use acceptable if scale makes
torch_stats worth considering?
2. Default Lightweight EDA For Local Data Paths
If the user provides a local data path or loader that can be inspected, run a
lightweight EDA pass by default before choosing model structure.
The purpose of this pass is to support model-structure routing. It is not a
full exploratory analysis report, feature-selection pass, or visualization
exercise.
Use the same small, repeatable checklist each time:
- Inspect sample count or row count so the scale is concrete.
- Inspect a few representative rows or records to identify what one
observation appears to be.
- Inspect missingness at a field level when it may change the structure,
especially for optional fields or partially observed tuples.
- Inspect discrete cardinalities for fields that look categorical, binary, or
identifier-like.
- Inspect sequence lengths when any field appears variable-length, ordered, or
nested as a list-like object.
- Inspect grouping or repeated-key structure when there are obvious IDs,
labels, user/item pairs, session keys, or repeated entities.
Keep this pass lightweight:
- Prefer small representative slices over broad profiling.
- Prefer field summaries that affect structure choice over generic descriptive
statistics.
- Stop once there is enough evidence to decide the observation unit, field
roles, and whether grouping, sequence structure, or optional substructure is
present.
- Do not expand into correlations, plots, hypothesis testing, or a full
notebook-style report unless the user explicitly asks for deeper EDA.
Ask a follow-up question instead of guessing when the lightweight pass still
leaves a structural ambiguity, for example:
- it is unclear what should count as one observation
- multiple fields could be the grouping or conditioning key
- missingness could mean either optional structure or a data-quality problem
- a sequence-like field might instead be an unordered set or bag
- the loader or file format prevents direct inspection of representative rows
When asking a follow-up, keep it narrow and tied to the next routing decision.
3. Structure First
- Decide the observation structure before naming an estimator family.
- Start with the simplest accurate description: scalar, vector, tuple, record,
set, sequence, ranking, or mixed observation.
- When the task is underspecified, default to a reusable shared model first:
composite for heterogeneous records, mixture-of-composites for latent
subtypes, and joint mixtures for paired views where later conditioning or
transfer is likely.
- When that heterogeneous latent model is specifically Bayesian or should use
a DPM to infer the active component count, route to a
dmx.bstats composite
inside a DPM rather than forcing the ordinary dmx.stats mixture path.
- Only prefer a narrow task-specific model first when the downstream target is
already fixed and the extra shared structure would not plausibly be reused.
- Read
references/hierarchy-and-data-structure.md before choosing
field-level estimators or routing into estimator catalogs.
4. Primary Model And Baseline Policy
For vague or only partially specified tasks, do not fan out into a wide model
search.
- Fit
1 primary model + 1 baseline.
- Make the primary model the best reusable shared model suggested by the
observation structure.
- Make the baseline structurally meaningful and simpler, so the comparison
answers whether the extra joint or latent structure is justified.
Good baseline patterns include:
- joint model vs simpler single-view or independent composite model
- mixture-of-composites vs plain composite model
- keyed shared model vs fully separate per-group or per-label fits
5. Choose The Next Skill Or Reference
- Use
references/hierarchy-and-data-structure.md for structure-first routing:
base estimator vs composite vs mixture, sequence/HMM, grouped sharing, joint
mixture, and heterogeneous mixture decisions.
- Route implementation-heavy local fitting work to
dmx-local-modeling.
- Route Python source edits, examples, or library changes to
dmx-python-implementation.
- Keep this skill lean. Do not inline long estimator catalogs, notebook
heuristics, or detailed fitting recipes here.
Output Expectations
- Restate the inferred local modeling problem in
dmx-learn terms.
- Name the modeling surface and starting point: normally an explicit
dmx.stats estimator, or dmx.bstats for Bayesian, variational, DPM, and
automatic Bayesian-mixture work. Explicitly note when the default is a
reusable shared model rather than a narrow task-specific one.
- For underspecified tasks, name one primary model and one baseline instead of
proposing a broad candidate sweep.
- Call out any scope boundary, especially distributed-workflow requests.
- Hand off detailed fitting or code-generation work to the narrower local skill
instead of turning this file into a monolithic reference.
1---2name: dmx-expert-orchestrator3description: Main entry point for local `dmx-learn` modeling requests. Use to scope the problem, infer the observation structure, keep the workflow on local data, and route detailed implementation to narrower repo-local skills or references. Default to explicit `dmx.stats` construction for ordinary non-Bayesian work and route Bayesian, variational, DPM, and automatic mixture work to `dmx.bstats`. Do not use for Spark, MPI, or other distributed estimation workflows.4---56# Dmx Expert Orchestrator78Use this skill as the top-level router for local modeling requests in9`dmx-learn`.1011Keep the first pass focused on five decisions:12131. Is the request local and in scope for `dmx-learn`?142. Where is the data, and can it be inspected directly?153. What does one observation look like?164. Does the objective call for ordinary non-Bayesian estimation or for priors,17 variational inference, a DPM, or automatic Bayesian model construction?185. Should the first model be a base estimator, composite, or mixture, and which19 narrower skill or reference should carry the detailed implementation?2021## Modeling Surface2223- Treat explicit `dmx.stats` construction as the default for ordinary24 non-Bayesian local modeling.25- Choose `dmx.bstats` when the request requires Bayesian priors or expected26 log-density behavior, local variational estimation, a truncated27 Dirichlet-process mixture (DPM), or automatic construction intended to feed28 a Bayesian mixture workflow.29- Treat `get_estimator(data, use_bstats=True)` and `get_dpm_mixture(data, ...)`30 from `dmx.utils.automatic` as first-class local routes for those use cases.31 They are deliberate `bstats` paths, not fallbacks.32- Prefer explicit estimator construction when the non-Bayesian model family is33 known. Do not use automatic routing merely to avoid choosing a clear34 `dmx.stats` estimator.35- If the downstream task is not fully fixed, prefer fitting one reusable joint,36 composite, or composite-mixture model before narrowing to a task-specific37 conditional path.38- For heterogeneous data with unknown latent subtype count, make a DPM over39 `dmx.bstats.CompositeEstimator` components the main high-value Bayesian40 route. The composite preserves field semantics while the truncated DPM and41 variational optimizer infer a useful finite mixture.42- Mention `torch_stats` only when the user's scale or repeated inference needs43 make accelerator-backed fitting a plausible next step.4445## Hard Scope Boundary4647- This skill is for local and in-memory modeling workflows.48- Local `dmx.bstats`, `dmx.bstats.bestimation`, and49 `dmx.utils.automatic` workflows are in scope.50- Do not use it for Spark, MPI, cluster scheduling, or other distributed51 estimation paths.52- Do not substitute `get_dpm_mixture_mpi`, `dmx.mpi4py.bstats`, or53 `dmx.mpi4py.utils` for the local helpers. Those are separate MPI-specific54 workflows even when they operate on the same `bstats` model types.55- If the user asks for distributed fitting, say it is out of scope and do not56 improvise a Spark or MPI workflow.5758## Routing Workflow5960### 1. Intake6162The intake goal is to get the minimum local-data facts needed to choose model63structure from the actual data, not from vague prompt wording.6465- Treat the local data path, loader path, or in-memory object as a first-class66 input.67- If a data path or loader is available, prefer inspecting a representative68 observation instead of asking the user to describe the whole dataset from69 memory.70- Ask what one observation looks like in concrete terms: one row, record,71 tuple, sequence, or other unit of modeling.72- Ask or infer field roles: continuous, categorical, count, binary, text,73 set-like, sequence-like, or optional.74- Ask whether any part of the observation is ordered, variable-length, or75 nested.76- Ask whether there are known groups, labels, repeated entities, or candidate77 conditioning keys.78- Ask for rough data size, including sample count and typical sequence length79 when relevant.80- Ask whether GPU use is acceptable before suggesting `torch_stats`.81- Ask whether the user needs explicit priors, variational inference, automatic82 model construction, or an unknown number of latent components; any of these83 can change the surface choice from `dmx.stats` to `dmx.bstats`.84- Ask whether the user already has a fixed downstream task or just wants a good85 reusable fitted model.8687Use a concise first-pass intake like this when the answers are not already88available from the supplied data:89901. Where is the local data or loader I should inspect?912. What does one observation look like?923. Which fields are continuous, categorical, counts, optional, set-like, or93 sequence-like?944. Are there labels, groups, repeated entities, or known conditioning keys?955. Roughly how many observations are there, how long are sequences if any, and96 is GPU use acceptable if scale makes `torch_stats` worth considering?9798### 2. Default Lightweight EDA For Local Data Paths99100If the user provides a local data path or loader that can be inspected, run a101lightweight EDA pass by default before choosing model structure.102103The purpose of this pass is to support model-structure routing. It is not a104full exploratory analysis report, feature-selection pass, or visualization105exercise.106107Use the same small, repeatable checklist each time:1081091. Inspect sample count or row count so the scale is concrete.1102. Inspect a few representative rows or records to identify what one111 observation appears to be.1123. Inspect missingness at a field level when it may change the structure,113 especially for optional fields or partially observed tuples.1144. Inspect discrete cardinalities for fields that look categorical, binary, or115 identifier-like.1165. Inspect sequence lengths when any field appears variable-length, ordered, or117 nested as a list-like object.1186. Inspect grouping or repeated-key structure when there are obvious IDs,119 labels, user/item pairs, session keys, or repeated entities.120121Keep this pass lightweight:122123- Prefer small representative slices over broad profiling.124- Prefer field summaries that affect structure choice over generic descriptive125 statistics.126- Stop once there is enough evidence to decide the observation unit, field127 roles, and whether grouping, sequence structure, or optional substructure is128 present.129- Do not expand into correlations, plots, hypothesis testing, or a full130 notebook-style report unless the user explicitly asks for deeper EDA.131132Ask a follow-up question instead of guessing when the lightweight pass still133leaves a structural ambiguity, for example:134135- it is unclear what should count as one observation136- multiple fields could be the grouping or conditioning key137- missingness could mean either optional structure or a data-quality problem138- a sequence-like field might instead be an unordered set or bag139- the loader or file format prevents direct inspection of representative rows140141When asking a follow-up, keep it narrow and tied to the next routing decision.142143### 3. Structure First144145- Decide the observation structure before naming an estimator family.146- Start with the simplest accurate description: scalar, vector, tuple, record,147 set, sequence, ranking, or mixed observation.148- When the task is underspecified, default to a reusable shared model first:149 composite for heterogeneous records, mixture-of-composites for latent150 subtypes, and joint mixtures for paired views where later conditioning or151 transfer is likely.152- When that heterogeneous latent model is specifically Bayesian or should use153 a DPM to infer the active component count, route to a `dmx.bstats` composite154 inside a DPM rather than forcing the ordinary `dmx.stats` mixture path.155- Only prefer a narrow task-specific model first when the downstream target is156 already fixed and the extra shared structure would not plausibly be reused.157- Read `references/hierarchy-and-data-structure.md` before choosing158 field-level estimators or routing into estimator catalogs.159160### 4. Primary Model And Baseline Policy161162For vague or only partially specified tasks, do not fan out into a wide model163search.164165- Fit `1 primary model + 1 baseline`.166- Make the primary model the best reusable shared model suggested by the167 observation structure.168- Make the baseline structurally meaningful and simpler, so the comparison169 answers whether the extra joint or latent structure is justified.170171Good baseline patterns include:172173- joint model vs simpler single-view or independent composite model174- mixture-of-composites vs plain composite model175- keyed shared model vs fully separate per-group or per-label fits176177### 5. Choose The Next Skill Or Reference178179- Use `references/hierarchy-and-data-structure.md` for structure-first routing:180 base estimator vs composite vs mixture, sequence/HMM, grouped sharing, joint181 mixture, and heterogeneous mixture decisions.182- Route implementation-heavy local fitting work to183 `dmx-local-modeling`.184- Route Python source edits, examples, or library changes to185 `dmx-python-implementation`.186- Keep this skill lean. Do not inline long estimator catalogs, notebook187 heuristics, or detailed fitting recipes here.188189## Output Expectations190191- Restate the inferred local modeling problem in `dmx-learn` terms.192- Name the modeling surface and starting point: normally an explicit193 `dmx.stats` estimator, or `dmx.bstats` for Bayesian, variational, DPM, and194 automatic Bayesian-mixture work. Explicitly note when the default is a195 reusable shared model rather than a narrow task-specific one.196- For underspecified tasks, name one primary model and one baseline instead of197 proposing a broad candidate sweep.198- Call out any scope boundary, especially distributed-workflow requests.199- Hand off detailed fitting or code-generation work to the narrower local skill200 instead of turning this file into a monolithic reference.