# Margin

Margin is another essential metric used in Active Learning. It uses the probabilities of different classes for each image and finds the difference between the two classes with the highest probabilities. The image with the *lowest* margin is suggested for labeling.&#x20;

Consider an example where we have two instances with the following class probabilities:

* Instance A: “cat” – 0.5, “milkshake” – 0.45, “cloud” – 0.05.
* Instance B: “cat” – 0.4, “milkshake” – 0.3, “cloud” – 0.3.

Here, in comparison to the Variance metric, the model will choose instance A over B:

* Margin of A = 0.5 – 0.45 = **0.05**
* Margin of B = 0.4 – 0.3 = **0.1**

Even though class probabilities of “cat” and “milkshake” are higher in A (0.5 and 0.45) than in B (0.4 and 0.3), the model is more likely to confuse them since the Margin in A is very low.

<figure><img src="https://wiki.cloudfactory.com/media/pages/docs/userdocs/active-learning/active-learning-in-hasty/margin/94bfa52f9e-1684131886/cats-margin.webp" alt=""><figcaption><p>Source</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudfactory.com/active-learning/active-learning-in-hasty/margin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
