nirs4all.controllers.models.pipeline_cv module
Utilities for forwarding pipeline folds to split-aware estimators.
- class nirs4all.controllers.models.pipeline_cv.PrecomputedFoldSplitter(folds: tuple[tuple[tuple[int, ...], tuple[int, ...]], ...], n_samples: int | None = None, label: str = 'pipeline')[source]
Bases:
objectPicklable sklearn-compatible splitter backed by explicit fold indices.
- for_training_subset(train_indices: Sequence[int], *, label: str | None = None) PrecomputedFoldSplitter | None[source]
Restrict this splitter to rows selected by
train_indices.train_indicesare row positions in the current splitter’s coordinate system. The returned splitter uses positions inX[train_indices].
- nirs4all.controllers.models.pipeline_cv.apply_pipeline_folds_to_aom_estimator(estimator: Any, splitter: PrecomputedFoldSplitter | None, *, policy: Any = 'auto', unavailable_reason: str | None = None) bool[source]
Inject pipeline folds into supported AOM estimator parameters.
Returns
Truewhen at least one estimator parameter was changed.