# Accuracy and Loss

**Accuracy** and **Loss** are the two most well-known and discussed [metrics](https://machine-learning.paperspace.com/wiki/metrics-in-machine-learning) in machine learning.&#x20;

![Source: Microsoft](https://2327526407-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvBP1svpACTB1R1x_U4%2F-LvGspxW3Zko2589SZEN%2F-LvH9eRozs1jmP8COBcX%2Fimage.png?alt=media\&token=056566bc-fc85-4cad-b654-4bd7a58f04e8)

### Accuracy&#x20;

Accuracy is a method for measuring a classification model’s performance. It is typically expressed as a percentage.  Accuracy is the count of predictions where the predicted value is equal to the true value.  It is binary (true/false) for a particular sample.  Accuracy is often graphed and monitored during the training phase though the value is often associated with the overall or final model accuracy.  Accuracy is easier to interpret than loss.

### Loss

A loss function, also known as a cost function, takes into account the probabilities or uncertainty of a prediction based on how much the prediction varies from the true value. This gives us a more nuanced view into how well the model is performing.&#x20;

Unlike accuracy, loss is not a percentage — it is a summation of the errors made for each sample in training or validation sets.  Loss is often used in the training process to find the "best" parameter values for the model (e.g. weights in neural network). During the training process the goal is to minimize this value.

The most common loss functions are **log loss** and **cross-entropy loss** (which yield the same result when calculating error rates between 0 and 1), as well as **mean squared error**, and **likelihood loss.**&#x20;

Unlike accuracy, loss may be used in both classification and regression problems.

### **Relationship Between Accuracy and Loss**

Most of the time we would observe that accuracy increases with the decrease in loss -- but this is not always the case. Accuracy and loss have different definitions and measure different things.  They often appear to be inversely proportional but there is no mathematical relationship between these two metrics.


---

# 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://machine-learning.paperspace.com/wiki/accuracy-and-loss.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.
