nirs4all.pipeline.dagml.exclude module

Host-side exclude and tag resolution for the dag-ml backend.

Run nirs4all’s real SampleFilters in-process on the CV train pool to compute the excluded / tagged sample ints (mirroring ExcludeController / TagController), so the dag-ml engine consumes the result as IDENTITY (sample-int sets) instead of marking the indexer. Augmented children cascade out with their origin (the origin-boundary invariant).

class nirs4all.pipeline.dagml.exclude.FoldLocalExclusion(members: set[int], steps: list[Any], cascade_to_augmented: bool, children_by_origin: dict[int, list[int]])[source]

Bases: set[int]

The keep_in_oof=True exclusion: members are the full-train (refit) exclusion.

Each CV fold refits the exclude steps on its own train rows (apply()), so validation targets never decide which rows a fold trains on; the members mark the envelope for lineage and the refit, and the fold set declares train_exclusion: "fold_local" so DAG-ML trains each fold on its host train list. Truthy even when empty: a fold may exclude rows that the full-train fit keeps.

apply(spectro: Any, folds: list[tuple[list[int], list[int]]]) → list[tuple[list[int], list[int]]][source]

folds with each train list minus the exclusion fitted on that train list alone.

cascade_to_augmented: bool
children_by_origin: dict[int, list[int]]
steps: tuple[Any, ...]