Keep small cohorts visible without overclaiming their scores
An aggregate score can improve while a cohort becomes substantially worse. A deployment report should retain both cohort counts and error measurements so a reviewer can see how much evidence supports each number. Hiding small cohorts entirely can hide an important coverage problem.
This exercise reports mean absolute error for every named cohort and marks whether it reaches a required count. That count is a reporting threshold, not a statistical guarantee. Compare confidence and missingness before making a release decision, and define cohorts before inspecting results to reduce selective reporting.
groups=["new","new","returning"]
errors=[1.,3.,10.]
print({g:sum(e for k,e in zip(groups,errors) if k==g) for g in set(groups)})Review the design
A sample-count flag does not establish fairness, causality or sufficient power. The report is evidence for a review, and the choice of metric, cohort and acceptable harm needs a separate domain-specific decision.
Your task
Implement cohort_mae(groups,truth,predicted,min_count). Return dict group->{n,mae,supported}. Require equal nonempty lengths, positive integer min_count and finite truth/predictions. supported means n>=min_count.
The explanation opens here once every check passes.