Skip to main content

aip_sdk.Metric

aip_sdk.Metric(scorer: str, mean: float, std: float, count: int, pass_rate: float)

Aggregated per-scorer summary statistics.

Attributes

  • mean float: Mean score across every row this scorer produced a real value for. float("nan") when count is 0 — the scorer was legitimately undefined for every row (e.g. a size-based metric on a dataset with no small objects), not a real score of 0. Check with math.isfinite(mean) and count > 0 before treating it as a number. Note nan != nan: an equality check against another possibly-NaN mean silently reads as "not equal" when either side is simply unmeasured, not only when they genuinely differ — guard both sides with isfinite/count first if the comparison is asserting they disagree, or the check passes on "nothing was measured" the same way it would on a real difference.
  • std float: Standard deviation across the same rows. nan whenever mean is (zero usable rows), and also nan at count == 1 even though mean is real then — a sample standard deviation is undefined for a single point, not zero (same convention as pandas.Series([x]).std()).
  • pass_rate float: Fraction of scored rows at or above the scorer's threshold. nan when count is 0, for the same reason as mean — distinct from a real 0.0, which means every row was scored and every one failed the threshold (count > 0, below_threshold == count).

aip_sdk.Metric.count​

aip_sdk.Metric.count: int

No docstring is defined in the source.

aip_sdk.Metric.mean​

aip_sdk.Metric.mean: float

No docstring is defined in the source.

aip_sdk.Metric.pass_rate​

aip_sdk.Metric.pass_rate: float

No docstring is defined in the source.

aip_sdk.Metric.scorer​

aip_sdk.Metric.scorer: str

No docstring is defined in the source.

aip_sdk.Metric.std​

aip_sdk.Metric.std: float

No docstring is defined in the source.