Milestone 4 of 8
Inspect descriptive source-group slices
Calculate traceable group counts and match fractions with visible denominators, without ranking or explaining the groups.
Slices make the same count visible for named subsets of the fixture. They are descriptions, not explanations of why one group differs.
Goal
Group aligned items by the configured source_group, calculate counts and
match fractions for both systems, retain item IDs, and show every denominator.
Inputs
Use output/aligned_items.csv and the slice field and order from the validated
configuration. Each group has an item count, a correct count, and a match
fraction for baseline and candidate.
The group names are neutral fixture values. Do not rename them as demographic groups, infer a cause for a difference, or rank groups as if the fixture were a fairness study.
Deliverables
Implement slice aggregation in src/counts.py or a clearly separated helper.
Save output/slice_results.csv with group, item count, correct count, and
match fraction for both systems. Keep the item IDs behind each group available
for an audit or a compact trace section.
Record one observation about a group with its numerator and denominator in the report. State the observation before offering any hypothesis, and make clear that it describes only these supplied records.
Checks
Check that group counts sum to the total item count for each system, correct counts agree with aligned match statuses, and every fraction uses the visible group denominator. Reconstruct one group from its item IDs and compare the saved row.
Use a fixture with a one-item group and a group whose match count is zero. Check that no group disappears because its fraction is zero and that source groups and item IDs are not mutated.
Workspace
Keep slice calculation in src/counts.py and derive it from aligned records.
Write slice_results.csv under output/; plotting belongs to the later fair
summary milestone.
Hints
HintShow the denominator
HintObservation comes first
Review
Trace one group row back to its item IDs and match statuses. Explain why a source-group slice is descriptive evidence and not a fairness or causal conclusion.
How to check your work
Checks compare slice columns, denominators, and item traceability with the supplied fixture. The supplied fixture does not rank the groups.