Pass rate per prompt version, with a 95 percent Wilson score range, and a comparison with a baseline version.
Input is a CSV with the columns case_id, version (a label such as v1) and passed
(yes or no, any case: whether the output passed YOUR check). Extra columns are ignored.
A (case_id, version) pair may appear only once. Version labels are compared as written
(after trimming), so v1 and V1 are two versions.
The Wilson score range for k passes out of n cases, with p = k / n and z = 1.96
(fixed), is
centre = (p + z^2 / (2n)) / (1 + z^2 / n)
half = z * sqrt(p (1 - p) / n + z^2 / (4 n^2)) / (1 + z^2 / n)
range = centre - half to centre + halfPass rates and differences are exact (integer arithmetic, rounded half up to 1 decimal). The Wilson ends are computed in floating point and rounded to 1 decimal. Two ranges "overlap" when, on the 1-decimal ends as printed, each one starts at or below the point where the other ends. The tool decides nothing: a small number of cases cannot support a conclusion.
Summary
Functions
Signed difference in percentage points, version minus baseline, exact, 1 decimal.
True when two summaries' 1-decimal Wilson ranges overlap.
Parse the CSV text into a list of rows.
Divide num / den * mult exactly (non-negative integers) and format with decimals
places, rounding half up. Returns "n/a" when den is zero.
Printable report. baseline must be a version present in the rows, otherwise
{:error, message} is returned.
Per-version summary sorted by label: version, cases, passed, and the Wilson ends
low and high in tenths of a percent (integers).
95 percent Wilson score range for k passes out of n cases (n > 0), as
{low, high} in percent, floats clamped to 0 and 100.
Types
Functions
Signed difference in percentage points, version minus baseline, exact, 1 decimal.
True when two summaries' 1-decimal Wilson ranges overlap.
Parse the CSV text into a list of rows.
@spec ratio(non_neg_integer(), non_neg_integer(), pos_integer(), non_neg_integer()) :: String.t()
Divide num / den * mult exactly (non-negative integers) and format with decimals
places, rounding half up. Returns "n/a" when den is zero.
Printable report. baseline must be a version present in the rows, otherwise
{:error, message} is returned.
Per-version summary sorted by label: version, cases, passed, and the Wilson ends
low and high in tenths of a percent (integers).
@spec wilson(non_neg_integer(), pos_integer()) :: {float(), float()}
95 percent Wilson score range for k passes out of n cases (n > 0), as
{low, high} in percent, floats clamped to 0 and 100.