Canonical docs
In the research projects
The Python project composes selected, already evaluated fitted objects through Cohort.from_python. The Compiled project walk_forward scenario binds reconstructed qualified folds. Member identity, output units and available context must agree before aggregation.
What this package owns
This package owns the cohort-level inference surface:
Cohort.from_python(sensors)for live mean/vote/custom aggregation, and artifact-backedCohortconstruction for selected experiment permutations- single-file cohort (
sfc) strategies for choosing those permutations from experiment artifacts
It does not own:
- experiment search execution (owned by
limen.experiment) - raw market data infrastructure
- downstream decisioning/execution logic (outside Limen)
Key entry points
| Entry point | Use case | Notes |
|---|---|---|
Cohort |
Aggregate retained Python fits or compatible reconstructed native members at inference time | Supports probability-weighted and majority-vote fallback modes |
bayesian_cohort |
Bind observed binary outcomes to live Python members | Fixed Beta–Bernoulli reliability-weighted voting; see the canonical Cohort documentation |
BUILTIN_SELECTORS |
Map selector names to built-in selector modules | Exported at the package root |
limen.cohort.sfc.all.select |
Default "use every round" selector | Preserves existing omitted-permutation_ids behavior |
limen.cohort.sfc.top_n.select |
Results-column ranker | Requires results.csv |
limen.cohort.sfc.backtest_pareto.select |
Trading-metric Pareto selection | Uses backtest return/risk columns |
limen.cohort.sfc.diverse_metrics.select |
Metric-diverse member selection | Uses PCA/KMeans medoids over metric columns |
Package map
| Module or family | Responsibility |
|---|---|
cohort.py |
Cohort entry points + compiled aggregation |
_python_cohort.py |
Live composition and callback boundary |
sfc/ |
Single-file cohort strategies |
all.py |
select(context) -> ids |
top_n.py |
select(context, *, column, n) -> ids |
backtest_pareto.py |
select(context, *, target_count) -> ids |
diverse_metrics.py |
select(context, *, target_count) -> ids |
cohort/├── README.md├── __init__.py├── _fold_sources.py├── _python_cohort.py├── _round_sources.py├── bayesian.py├── cohort.py└── sfc/Cohort quick behavior
For live fitted Sensors, start with Cohort.from_python(sensors). Matching explicit
Sensor output IDs permit default mean; optional preparation, output mapping and
aggregation functions provide custom control. Compiled members require an explicit
mapper/common meaning/cutoff. See the Python contract
for alignment, blocking, availability and live provenance.
The artifact-backed constructor follows these rules:
- Construct from exactly one experiment source (
experiment_idorexperiment_log_path) - Validate explicit or selector-produced
permutation_ids - Bind each member to its selected source and architecture; admit mixed declared binary outputs
- Infer homogeneous aggregation from architecture capability; bind mixed aggregation from native binary declarations:
probability_weightedwhen probability output is supportedmajority_votefallback otherwise
predict(raw_klines)returns oneBarPredictionfor the last barpredict_all(raw_klines)returnslist[BarPrediction]__call__(raw_klines)aliasespredict_all(raw_klines)
See Cohort for full contract and examples.
Selector quick behavior
- Selectors are one-file strategies with one public
select(context)function - Selectors receive a context dict and return permutation IDs only
- Cohort owns all validation after selector execution
- Built-ins cover all-round, single-column rank, backtest Pareto, and metric diversity selection
Adjacent modules
limen.experimentowns manifests and parameter search;limen.inferenceowns Trainer and Sensor reconstruction used by Cohort flowslimen.logprovides analysis surfaces commonly used before selector-driven promotionlimen.sfdand reference architectures define member model output behavior