Free · Accuracy and error measures
Classification Accuracy and Percent Error
Compute accuracy from confusion counts or prevalence and classification rates, or compare a measurement with a nonzero reference.
- Formula & worked example
- Private in your browser
- No signup
Calculator inputs
Loading calculator…
How to use this calculator
- Enter the known values in the units shown. Results update as you type.
- Where results are editable, change one to solve backwards. Lock a value to hold it fixed.
- Use the worked example to check the method. Reset restores the starting fields.
Private by default
Inputs and results stay in this browser tab. Bookify does not upload or store the values you enter.
Formula and method
With 40 correct positive and 40 correct negative classifications out of 100 observations, accuracy is 80%. A measurement of 90 relative to a reference of 100 has 10% error.
Accuracy = (TP+TN)/(TP+TN+FP+FN); percent error = 100 |observed−reference|/|reference|
Worked example
Enter these known values and leave the other values blank.
- Select a method
- Standard method
- True positive
- 40
- True negative
- 40
- False positive
- 10
- False negative
- 10
- Accuracy
- 80 %
- Sensitivity
- 80 %
- Specificity
- 80 %
Assumptions and limitations
- Counts are nonnegative whole observations; accuracy needs at least one observation. A class-specific rate is undefined when that class has no observations.
- The prevalence method combines sensitivity and specificity using the supplied prevalence. Rates are proportions from zero to one.
- Percent error uses the magnitude of a nonzero reference, including negative references. It measures relative discrepancy rather than classification accuracy.
- A percent error can correspond to two observed values. The editable inverse chooses the same-sign outward branch: observed = reference × (1 + error/100). It does not choose the alternative branch toward or across zero. If a requested nonzero difference disappears at working precision, the inverse stays blank.
- For a zero observation and 100% error, a nonzero reference is not uniquely determined. Enter the reference directly; the inverse reference stays blank.
Common questions
Why can the inverse return a different observation?
Percent error loses the sign of a difference. The inverse chooses the same-sign observation farther from zero, so it selects one valid branch rather than recovering every possible original measurement.
What does zero observed value mean?
Every nonzero reference has 100% error from zero. That information does not identify the reference. Enter a known nonzero reference directly, or change the observation to use the selected inverse branch.
Can accuracy be zero?
Yes. If every classification is wrong, the overall accuracy is zero. An individual sensitivity or specificity needs a nonempty corresponding class.
References
- NIST DLMF: absolute and relative error measures
- University of Iowa: percent error formula
- Calculation definition and unit reference
Use the magnitude of the nonzero reference for percent error, preserving all classification modes and the captured same-sign outward inverse family. A zero observation cannot determine a nonzero reference on this inverse branch, so it stays blank instead of falsely computing zero. Inverse targets also stay blank when a nonzero discrepancy would disappear at working precision. Confusion counts are nonnegative whole numbers, classification rates belong to [0,1], a classification dataset is nonempty, and percent error is nonnegative. A nonzero reference remains required.
Related calculators
Explore accuracy and error measures or browse all statistics calculators.