Skip to content

SamplingConfig Class

ml_debugger.data_filter.config.sampling_config.SamplingConfig

Bases: BaseModel

Sampling configuration for query result selection.

Attributes:

Name Type Description
method str

Sampling method. - "random": Random sampling from candidates within [min_value, max_value] range. - "class_balanced": Per-class quota random sampling.

min_per_class int

Target number of samples per class (method="class_balanced" only). This is a target quota, not a guarantee. Classes with no candidates are skipped, and budget exhaustion may limit per-class counts.

seed Optional[int]

Random seed for reproducibility (method="random" only). Ignored when method="class_balanced" (deterministic by design).

min_value Optional[float]

Lower bound (inclusive) on rank_value for candidate filtering. Required (at least one of min_value/max_value) when method="random". Optional for method="class_balanced".

max_value Optional[float]

Upper bound (inclusive) on rank_value for candidate filtering. Required (at least one of min_value/max_value) when method="random". Optional for method="class_balanced".

validate_dict(data) classmethod

Validate dict and return result with guide message.