dataeval.selection.Selection

class dataeval.selection.Selection

Base class for all selection criteria used with Select.

Custom selection criteria should subclass this and set stage to control execution order:

  • SelectionStage.STATE (0) — set size limits (e.g. Limit)

  • SelectionStage.FILTER (1) — narrow indices (e.g. ClassFilter)

  • SelectionStage.ORDER (2) — reorder indices (e.g. Shuffle)

Subclasses must implement __call__ which mutates the Select wrapper’s internal index list in place.

Subclasses that read the target of each datum (e.g. dataset[i][1]) should set requires to declare the MAITE datum shape they need. Select aggregates these and validates the source dataset once, upfront, raising MaiteShapeError before any selection runs.