# Draw a confusion matrix in VectorPaint: precision, recall and accuracy

Language: en
Canonical: [Draw a confusion matrix in VectorPaint: precision, recall and accuracy](<https://allluckly.cn/en/guides/vectorpaint-confusion-matrix-precision-recall-denominators/>)
中文：[中文 HTML](<https://allluckly.cn/guides/vectorpaint-confusion-matrix-precision-recall-denominators/>)
English: [English HTML](<https://allluckly.cn/en/guides/vectorpaint-confusion-matrix-precision-recall-denominators/>)
Published: 2026-11-26T00:00:00+08:00
Modified: 2026-11-26T09:47:10+08:00
Author: Bison

Build a matrix from fictional classification results and check four cells and three denominators.

English translation of the [Chinese original](<https://allluckly.cn/guides/vectorpaint-confusion-matrix-precision-recall-denominators/>), translated on 2026-11-26. Original publication dates, attribution, code and version notes are retained.

Build a matrix from fictional classification results and check four cells and three denominators.

## Define fictional data

Imagine a practice classifier labels 100 fictional samples. Of 40 actually positive samples, 30 are predicted positive and 10 negative. Of 60 actually negative samples, 15 are predicted positive and 45 negative. These data are an arithmetic exercise, not model performance or medical screening. Write actual and predicted class as separate axes.

## Set up the matrix

Create a canvas in VectorPaint and save an editable original. Use visible rectangle, line and text controls to draw two equal columns and two equal rows with clear cell boundaries. Reserve space above for predicted-column labels, left for actual-row labels, and right and below for totals. Do not assume the app automatically constructs or calculates a confusion matrix.

## Label both axes

Label rows Actual positive and Actual negative, and columns Predicted positive and Predicted negative. Identify the axes clearly near the corner. Once this orientation is chosen, calculations must follow it. Other sources may transpose rows and columns; their labels and calculations must match their own orientation. Do not rely solely on color to distinguish classes.

## Fill four cells

Put TP=30 at actual positive/predicted positive and FN=10 at actual positive/predicted negative. Put FP=15 at actual negative/predicted positive and TN=45 at actual negative/predicted negative. Include a descriptive label as well as the abbreviation and value. Check the actual row first and predicted column second; do not swap FP and FN merely by comparing their magnitudes.

## Check row and column totals

Actual-positive row: 30+10=40; actual-negative row: 15+45=60. Predicted-positive column: 30+15=45; predicted-negative column: 10+45=55. All four cells sum to 100, as do row totals and column totals. Place totals outside the matrix and label them so they are not mistaken for additional outcomes.

## Calculate precision

Precision asks how many predicted positives are actually positive: TP/(TP+FP)=30/45=2/3, approximately 66.7%. Mark the predicted-positive column with a bracket or “denominator 45” and connect it to the formula. Do not use the actual-positive row total of 40. The decimal is rounded; keep the exact fraction as well.

## Calculate recall

Recall asks how many actual positives were predicted positive: TP/(TP+FN)=30/40=3/4=75%. Mark “denominator 40” beside the actual-positive row instead of reusing the predicted-positive total of 45. Both precision and recall use TP=30 but answer different questions; keep row and column brackets visually distinct.

## Calculate accuracy

Accuracy uses all samples: (TP+TN)/total=(30+45)/100=75%. Accuracy and recall happen to be 75% in this example, but their numerators and denominators differ and they need not always agree. Place three formulas below the matrix and identify denominators 45, 40 and 100. Google’s public course defines these measures.

## Check error types

FP=15 means actually negative but predicted positive; FN=10 means actually positive but predicted negative. They are not interchangeable. Correct predictions total 30+45=75, errors total 15+10=25, and both sum to 100. A lone 75% figure does not reveal the two error counts; retain the four original cells.

## Compare a controlled correction

On a copy, move five actual-positive samples from FN to TP: TP becomes 35 and FN becomes 5, while FP and TN remain unchanged. Actual positives stay 40 and the total stays 100. Precision becomes 35/(35+15)=70%, recall 35/40=87.5% and accuracy (35+45)/100=80%. Changing only one cell without reducing the other would invent additional samples.

## Check scope and threshold

State below the figure that counts are fictional and use one fixed classification threshold. Changing a threshold may change all four cells; this chart cannot establish performance at another threshold. Class imbalance, error costs and task context affect which metric matters. Do not present one example percentage as a universal pass mark. Readers should be able to recompute from the four cells.

## Provide a reading order

Explain beside the figure: choose the actual row first, then the predicted column; their intersection is the count. Actual negative/predicted positive locates 15, while actual positive/predicted negative locates 10. Ask a reader to interpret all four cells using only the legend, then check against the source list. If they misread it, inspect axis placement and direction before swapping values. This text also helps readers who cannot rely on color.

## Record calculation precision

Keep precision as 30/45 or 2/3 and mark 66.7% as approximate; recall and accuracy happen to equal 75% exactly here. Do not round 30/45 to 67% and present it as exact. If space permits only one decimal on the graphic, retain fractions and denominators in the table below so readers can recalculate. Rounding does not change the four source counts. Recheck denominators 45, 40 and 100 before export and retain the fictional source table. If a denominator is zero, the corresponding formula is undefined rather than directly applicable; do not call an empty denominator a zero result.

## Save and troubleshoot

Save the editable original and use a visible share or export control to save a separate PNG or PDF. Reopen it and inspect axis labels, four cells, totals and formulas for clipping. If precision is 30/40, check whether the actual-positive row was used by mistake; if recall is 30/45, check whether the predicted-positive column was used instead. Counts and threshold are exercise assumptions; no automatic calculation or device test is claimed.

## Related guides and sources

[Two-way table denominators](<https://allluckly.cn/en/guides/vectorpaint-two-way-table-conditional-denominator/>); [Funnel retention denominators](<https://allluckly.cn/en/guides/vectorpaint-sequential-funnel-stage-retention-denominators/>).

Checked 26 November 2026: [Google classification metrics](<https://developers.google.com/machine-learning/crash-course/classification/accuracy-precision-recall>); [Apple public lookup](<https://itunes.apple.com/lookup?id=1587272880&country=cn>).

