Start from two exact confusion grids.

highlighted = computed this step

Start with grid A

Grid A has TP=2, FP=1, FN=1, and TN=1.

A=(TP,FP,FN,TN)=(2,1,1,1)A=(TP,FP,FN,TN)=(2,1,1,1)
F1 Score ExactlyExact F1 fractions from two confusion grids.two confusion grids with exact F1 fractionsgrid Agrid A confusion gridactualpred Ppred NPTP=2FN=1NFP=1TN=1precision and recall side labelsratefractionprecision TP/(TP+FP)2/3 = 2/3recall TP/(TP+FN)2/3 = 2/3F1 denominator blocks2TP=4FP=1FN=12TP+FP+FN=6F1=4/6 = 2/3grid Bgrid B confusion gridactualpred Ppred NPTP=1FN=2NFP=0TN=2precision and recall side labelsratefractionprecision TP/(TP+FP)1/1 = 1recall TP/(TP+FN)1/3 = 1/3F1 denominator blocks2TP=2FP=0FN=22TP+FP+FN=4F1=2/4 = 1/2F1 is computed from displayed counts; denominator is 2TP plus FP plus FNdoes not claim: NOT best metric; NOT future performanceNOT accuracy; NOT calibration; NOT fairness; NOT safetyNOT generalization; NOT probability truth

Show grid B too

Grid B has TP=1, FP=0, FN=2, and TN=2.

B=(TP,FP,FN,TN)=(1,0,2,2)B=(TP,FP,FN,TN)=(1,0,2,2)
F1 Score ExactlyExact F1 fractions from two confusion grids.two confusion grids with exact F1 fractionsgrid Agrid A confusion gridactualpred Ppred NPTP=2FN=1NFP=1TN=1precision and recall side labelsratefractionprecision TP/(TP+FP)2/3 = 2/3recall TP/(TP+FN)2/3 = 2/3F1 denominator blocks2TP=4FP=1FN=12TP+FP+FN=6F1=4/6 = 2/3grid Bgrid B confusion gridactualpred Ppred NPTP=1FN=2NFP=0TN=2precision and recall side labelsratefractionprecision TP/(TP+FP)1/1 = 1recall TP/(TP+FN)1/3 = 1/3F1 denominator blocks2TP=2FP=0FN=22TP+FP+FN=4F1=2/4 = 1/2F1 is computed from displayed counts; denominator is 2TP plus FP plus FNdoes not claim: NOT best metric; NOT future performanceNOT accuracy; NOT calibration; NOT fairness; NOT safetyNOT generalization; NOT probability truth

Every rate comes from counts

The precision, recall, and F-score rows are computed from these displayed counts.

rates come from visible counts\text{rates come from visible counts}
F1 Score ExactlyExact F1 fractions from two confusion grids.two confusion grids with exact F1 fractionsgrid Agrid A confusion gridactualpred Ppred NPTP=2FN=1NFP=1TN=1precision and recall side labelsratefractionprecision TP/(TP+FP)2/3 = 2/3recall TP/(TP+FN)2/3 = 2/3F1 denominator blocks2TP=4FP=1FN=12TP+FP+FN=6F1=4/6 = 2/3grid Bgrid B confusion gridactualpred Ppred NPTP=1FN=2NFP=0TN=2precision and recall side labelsratefractionprecision TP/(TP+FP)1/1 = 1recall TP/(TP+FN)1/3 = 1/3F1 denominator blocks2TP=2FP=0FN=22TP+FP+FN=4F1=2/4 = 1/2F1 is computed from displayed counts; denominator is 2TP plus FP plus FNdoes not claim: NOT best metric; NOT future performanceNOT accuracy; NOT calibration; NOT fairness; NOT safetyNOT generalization; NOT probability truth