# Classification Model

SPAM detection is “considered” a toy example.

As such, we will explore two of the simples learning models: Naive Bayes and Logistic Regression.

<figure><img src="https://1787839673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM1gGqj8SpSFcWdTifH2Y%2Fuploads%2Fi7gJfsMGtqnoG6whJicy%2Fa.png?alt=media&#x26;token=37160389-e4e1-42bd-9f38-28b08698976d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1787839673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM1gGqj8SpSFcWdTifH2Y%2Fuploads%2FBbVSVqmM6AxX7fnoNwyZ%2Fa.png?alt=media&#x26;token=600c87c0-a9cf-4905-a57c-b8fa5171c201" alt=""><figcaption></figcaption></figure>

## Model Evaluation

Classification model can be evaluated using a confusing matrix.

The simplest methods to evaluate a model is through accuracy:

* acc = (TP + TN) / (TN + TN + FP + FN)

<figure><img src="https://1787839673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM1gGqj8SpSFcWdTifH2Y%2Fuploads%2Fj1FttKjphi1jACeQTgZm%2Fa.png?alt=media&#x26;token=014dbca9-1352-4896-bb5f-0b222c1028cd" alt=""><figcaption></figcaption></figure>
