Skip to main content

limen.data.utils

Public helpers that form bars and split raw frames into the model-ready data_dict schema.

Canonical docs

What this package owns

Owns the manifest-facing data helpers: the compute_data_bars() bar-formation entry point, the train/validation/test split functions, and random window slicing. Does not own raw data access (owned by limen.data.HistoricalData) or the low-level bar builders (owned by limen.data.bars).

Key entry points

Entry pointUse caseNotes
compute_data_barsPublic bar-formation entry pointDispatches to limen.data.bars; used by set_bar_formation()
split_sequentialOrdered train/validation/test windowsThe standard manifest split
split_randomRandomised splitNon-sequential alternative
split_by_datesExplicit date-boundary splitFor fixed calendar windows
split_data_to_prep_outputBuild the data_dict (x_train, y_test, …)Does not mutate the passed split list or column list
split_data_to_rule_based_prep_outputdata_dict variant for rule-based SFDsPreserves columns rule strategies read
random_sliceRandom contiguous windowSampling helper

Adjacent modules

  • limen.data.HistoricalData produces the raw frames these helpers split.
  • limen.data.bars provides the bar builders compute_data_bars() dispatches to.
  • limen.experiment consumes the resulting data_dict through manifests and the Universal Experiment Loop.

Quick orientation

utils/
├── compute_data_bars.py # Public bar-formation entry point
├── splits.py # Train/validation/test split helpers
└── random_slice.py # Random window slicing helper

Things to know

  • split_data_to_prep_output() is non-mutating: it copies the split list and column list before building data_dict.
  • The data_dict keys (x_train, y_train, x_val, x_test, y_test, …) are the schema the rest of Limen's model code expects.
  • Rule-based SFDs need split_data_to_rule_based_prep_output() because they read raw columns the standard prep drops.