# Classifier

*noun*

say it: **“KLAS-uh-fy-er”** **/ˈklæsəˌfaɪər/**

A model that sorts examples into categories, such as deciding whether an email is spam.

## What is a **classifier**?

A **classifier** is a model that guesses a category for each example, such as spam or not spam, or which fruit is on
the scale. In scikit-learn its name usually ends in `Classifier`, as in `DecisionTreeClassifier`, and its `predict()`
hands back categories, not numbers.

```python
from sklearn.tree import DecisionTreeClassifier
fruit = [[120], [130], [180], [190]]   # grams
names = ["apple", "apple", "orange", "orange"]
classifier = DecisionTreeClassifier().fit(fruit, names)
print(classifier.predict([[125], [185]]))   # ['apple' 'orange']
```

## In a sentence

- “A spam **classifier** gives one of two answers for every email.”
- “The **classifier** labeled the 185-gram fruit an orange.”

Level: Apprentice · [More AI Basics terms at this level](https://www.ask-codey.com/glossary?category=ai&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/classifier
