Reference / Limen research

limen.cohort.sfc

Single-file cohort selectors that choose which experiment permutations a Cohort aggregates.

Contents

Canonical docs

In the research projects

The Compiled project walk_forward scenario establishes the recorded fold identities that compatible Cohort members retain. These selectors are optional Python component APIs. The YAML assessment path exposes metric, direction, top_k and folds; it does not load this selector registry. The Cohort component boundary distinguishes those controls.

What this package owns

Owns the built-in selector strategies that turn completed-experiment artifacts into a list of permutation ids for Cohort, plus the BUILTIN_SELECTORS registry that names them. Does not own cohort aggregation itself (owned by limen.cohort.Cohort) or experiment execution.

Key entry points

Entry point Use case Notes
BUILTIN_SELECTORS Name-to-selector registry Maps 'all', 'top_n', 'backtest_pareto', 'diverse_metrics'
all.select Use every round Default; preserves omitted-permutation_ids behavior
top_n.select Rank by one numeric results.csv column Requires results.csv in context
backtest_pareto.select Trading-metric Pareto selection Uses backtest return/risk columns
diverse_metrics.select Spread selection across metric space Favors complementary rather than similar rounds

Adjacent modules

  • limen.cohort.Cohort consumes the ids these selectors return.
  • limen.experiment produces the artifacts (results.csv, backtest columns) selectors read.

Quick orientation

Module or family Responsibility
all.py Select every permutation
top_n.py Rank by a numeric results column
backtest_pareto.py Pareto front over trading metrics
diverse_metrics.py Diverse spread across metric space
text · README.md
sfc/├── README.md├── __init__.py├── all.py├── backtest_pareto.py├── diverse_metrics.py└── top_n.py

Things to know

  • Every selector shares the signature select(context, *, ...). The selector result must ultimately contain nonempty string permutation IDs because Cohort rejects non-string entries during binding.
  • context is a SelectorContext (dict[str, Any]) carrying artifacts such as context['results']; each selector validates the keys it needs and raises ValueError when they are missing.
  • top_n requires a Polars results.csv frame. A frame with no usable numeric ranking rows returns []; Cohort then rejects the empty selection. A missing or wrong-typed frame raises immediately.

Limen / Python Research and Compiled ResearchReturn to the research book
Edit this sourceSource revision · 9bc8a630
Reference / keep your place
Find a passage