latent.stats.config¶
Configuration models for statistical evaluation.
Classes¶
MetricRubric¶
Per-metric rubric definition for ordinal scores.
RubricConfig¶
Collection of per-metric rubric definitions.
Functions¶
build_gated_report¶
build_gated_report(metrics: dict[str, MetricResult], gates: dict[str, float | GateSpec] | None = None) -> tuple[StatisticalReport, bool]
Build a StatisticalReport with optional quality gates.
Shared by flows that produce metrics directly (not via analyze()).
Args: metrics: Dict mapping metric name to MetricResult. gates: Optional dict mapping metric name to threshold (float or GateSpec).
Returns: Tuple of (StatisticalReport, all_passed).
default_rubric¶
Create a default rubric from observed score values.
extract_score_config¶
extract_score_config(output_type: type[BaseModel]) -> tuple[dict[str, str], dict[str, MetricRubric]]
Extract score_types and rubrics from a Pydantic output model.
Inspects Annotated metadata (BinaryScore, OrdinalScore, ContinuousScore)
on the output model's fields and converts them to the dicts expected
by latent.stats.report.analyze().
Args: output_type: Pydantic model class with Annotated score metadata.
Returns: Tuple of (score_types dict, rubrics dict).
load_rubric_config¶
Load rubric configuration from a YAML file.
Methods¶
MetricRubric.get_label¶
Get label for a level, falling back to generic.