---
title: classificationError
framework: createml
role: symbol
role_heading: Instance Property
path: createml/mlclassifiermetrics/classificationerror
---

# classificationError

The fraction of incorrectly labeled examples.

## Declaration

```swift
var classificationError: Double { get }
```

## Mentioned in

Creating a text classifier model Improving Your Model’s Accuracy

## Discussion

Discussion The classification error describes how many examples were incorrectly labeled divided by the total number of examples. Accuracy as a percentage may be more intuitive. You can calculate it as follows: let accuracy = (1 - metrics.classificationError) * 100 important: This is a useful metric only when the data is well-balanced between categories. For example, suppose you build a classifier to detect a rare disease with very few examples of sick patients compared to the number of healthy patients. Predicting that a new patient will always be healthy would be highly accurate (low classification error), but a poor disease detector. The precisionRecall and confusion properties provide more detail in these cases.

## See Also

### Understanding the model

- [precisionRecall](createml/mlclassifiermetrics/precisionrecall.md)
- [confusion](createml/mlclassifiermetrics/confusion.md)
- [confusionDataFrame](createml/mlclassifiermetrics/confusiondataframe.md)
- [precisionRecallDataFrame](createml/mlclassifiermetrics/precisionrecalldataframe.md)
