---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/loss-functions-regression.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# Regression: objectives and metrics

- [Objectives and metrics](#objectives-and-metrics)
- [Used for optimization](#usage-inforimation)

## Objectives and metrics

### MAE {#MAE}

$\displaystyle\frac{\sum\limits_{i=1}^{N} w_{i} | a_{i} - t_{i}| }{\sum\limits_{i=1}^{N} w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

### MAPE {#MAPE}

$\displaystyle\frac{\sum\limits_{i=1}^{N} w_{i} \displaystyle\frac{|a_{i}- t_{i}|}{\max(1, |t_{i}|)}}{\sum\limits_{i=1}^{N}w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

### Poisson {#Poisson}

$\displaystyle\frac{\sum\limits_{i=1}^{N} w_{i} \left(e^{a_{i}} - a_{i}t_{i}\right)}{\sum\limits_{i=1}^{N}w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->


### Quantile {#Quantile}

$\displaystyle\frac{\sum\limits_{i=1}^{N} (\alpha - I(t_{i} \leq a_{i}))(t_{i} - a_{i}) w_{i} }{\sum\limits_{i=1}^{N} w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "alpha" %}

The coefficient used in quantile-based losses.

_Default:_ 0.5

{% endcut %}

### MultiQuantile {#MultiQuantile}

$\displaystyle\frac{\sum\limits_{i=1}^{N} w_{i} \sum\limits_{q=1}^{Q} (\alpha_{q} - I(t_{i} \leq a_{i,q}))(t_{i} - a_{i,q}) }{\sum\limits_{i=1}^{N} w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "alpha" %}

The vector of coefficients used in multi-quantile loss.

_Default:_ 0.5

{% endcut %}

### RMSE {#RMSE}

$\displaystyle\sqrt{\displaystyle\frac{\sum\limits_{i=1}^N (a_{i}-t_{i})^2 w_{i}}{\sum\limits_{i=1}^{N}w_{i}}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

### RMSEWithUncertainty {#RMSEWithUncertainty}

$\displaystyle-\frac{\sum_{i=1}^N w_i \log N(t_{i} \vert a_{i,0}, e^{2a_{i,1}})}{\sum_{i=1}^{N}w_{i}} = \frac{1}{2}\log(2\pi) +\frac{\sum_{i=1}^N w_i\left(a_{i,1} + \frac{1}{2} e^{-2a_{i,1}}(t_i - a_{i, 0})^2 \right)}{\sum_{i=1}^{N}w_{i}}$,
where $t$ is target, a 2-dimensional approx $a_0$ is target predict, $a_1$ is $\log \sigma$ predict, and $N(y\vert \mu,\sigma^2) = \frac{1}{\sqrt{2 \pi\sigma^2}} \exp(-\frac{(y-\mu)^2}{2\sigma^2})$ is the probability density function of the normal distribution.

See the [Uncertainty section](https://catboost.ai/docs/en/references/uncertainty.md) for more details.

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

### LogLinQuantile {#LogLinQuantile}

Depends on the condition for the ratio of the label value and the resulting value:
$\begin{cases} \displaystyle\frac{\sum\limits_{i=1}^{N} \alpha |t_{i} - e^{a_{i}} | w_{i}}{\sum\limits_{i=1}^{N} w_{i}} & t_{i} > e^{a_{i}} \\ \displaystyle\frac{\sum\limits_{i=1}^{N} (1 - \alpha) |t_{i} - e^{a_{i}} | w_{i}}{\sum\limits_{i=1}^{N} w_{i}} & t_{i} \leq e^{a_{i}} \end{cases}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "alpha" %}

The coefficient used in quantile-based losses.

_Default:_  0.5

{% endcut %}

### Lq {#lq}

$\displaystyle\frac{\sum\limits_{i=1}^N |a_{i} - t_{i}|^q w_i}{\sum\limits_{i=1}^N w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "q" %}

The power coefficient.

Valid values are real numbers in the following range:  $[1; +\infty)$

_Default:_ Obligatory parameter

{% endcut %}


### Huber {#Huber}

$L(t, a) = \sum\limits_{i=0}^N l(t_i, a_i) \cdot w_{i}$

$l(t,a) = \begin{cases} \frac{1}{2} (t - a)^{2} { , } & |t -a| \leq \delta \\ \delta|t -a| - \frac{1}{2} \delta^{2} { , } & |t -a| > \delta \end{cases}$

User-defined parameters:

{% cut "delta" %}

The $\delta$ parameter of the Huber metric.

_Default:_ Obligatory parameter

{% endcut %}

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->


### Expectile {#Expectile}

$\displaystyle\frac{\sum\limits_{i=1}^{N} |\alpha - I(t_{i} \leq a_{i})|(t_{i} - a_{i})^2 w_{i} }{\sum\limits_{i=1}^{N} w_{i}}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "alpha" %}

The coefficient used in expectile-based losses.

_Default:_  0.5

{% endcut %}

### Tweedie {#Tweedie}

$\displaystyle\frac{\sum\limits_{i=1}^{N}\left(\displaystyle\frac{e^{a_{i}(2-\lambda)}}{2-\lambda} - t_{i}\frac{e^{a_{i}(1-\lambda)}}{1-\lambda} \right)\cdot w_{i}}{\sum\limits_{i=1}^{N} w_{i}}$

$\lambda$ is the value of the variance_power parameter.

Labels $t_i$ should be non-negative.

Large labels may cause numerical overflows and/or divergence when training a tweedie regression model.

On CPU, it is recommended to scale labels to range $[0,1000]$.

On GPU, it is recommended to scale lables to range $[0,1]$.

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "variance_power" %}

The variance of the Tweedie distribution.

Supported values are in the range (1;2).

_Default:_ Obligatory parameter

{% endcut %}

### LogCosh {#LogCosh}

$\displaystyle\frac{\sum_{i=1}^N w_i \log(\cosh(a_i - t_i))}{\sum_{i=1}^N w_i}$

**Usage information** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->


### FairLoss {#FairLoss}

$\displaystyle\frac{\sum\limits_{i=1}^{N} c^2\left(\frac{|t_{i} - a_{i} |}{c} - \log\left(\frac{|t_{i} - a_{i} |}{c} + 1\right)\right)w_{i}}{\sum\limits_{i=1}^{N} w_{i}}$

$c$ is the value of the smoothness parameter.

**Can't be used for optimization.** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

{% cut "use_weights" %}

The smoothness coefficient. Valid values are real values in the following range $(0; +\infty)$.

_Default:_ 1.0

{% endcut %}


### NumErrors {#NumErrors}

The proportion of predictions, for which the difference from the label value exceeds the specified value `greater_than`.

$\displaystyle\frac{\sum\limits_{i=1}^{N} I(|a_{i} - t_{i}|\geq \text{greater\_than}) w_{i}}{\sum\limits_{i=1}^{N} w_{i}}$

User-defined parameters: greater_than

**Can't be used for optimization.** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

### SMAPE {#SMAPE}

$\displaystyle\frac{100 \sum\limits_{i=1}^{N}\displaystyle\frac{w_{i} |a_{i} - t_{i} |}{(| t_{i} | + | a_{i} |) / 2}}{\sum\limits_{i=1}^{N} w_{i}}$

**Can't be used for optimization.** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->

### R2 {#R2}

$1 - \displaystyle\frac{\sum\limits_{i=1}^{N} w_{i} (a_{i} - t_{i})^{2}}{\sum\limits_{i=1}^{N} w_{i} (\bar{t} - t_{i})^{2}}$
$\bar{t}$ is the average label value:
$\bar{t} = \frac{1}{N}\sum\limits_{i=1}^{N}t_{i}$

**Can't be used for optimization.** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->


### MSLE {#MSLE}

$\displaystyle\frac{\sum\limits_{i=1}^{N} w_{i} (\log (1 + t_{i}) - \log (1 + a_{i}))^{2}}{\sum\limits_{i=1}^{N} w_{i}}$

**Can't be used for optimization.** See [more](#usage-information).

**User-defined parameters**

<!-- source: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->
{% cut "use_weights" %}

Use object/group weights to calculate metrics if the specified value is <q>true</q> and set all weights to <q>1</q> regardless of the input data if the specified value is <q>false</q>.

_Default:_ true

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-loss-functions/use-weights__desc__with__default__value.md -->


### MedianAbsoluteError {#MedianAbsoluteError}

$\displaystyle\text{median}(|t_{1} - a_{1}|, ..., |t_{N} - a_{N}|)$

**Can't be used for optimization.**  See [more](#usage-information).

**User-defined parameters**

No.

### Cox {#Cox}

$\displaystyle\sum\limits_{t_i > 0}\left( a_i - \log\sum\limits_{|t_j| \ge t_i} \exp(a_j)\right)$

Labels $t_i > 0$ mean occurence of the event at time $t_i$, and labels $t_i < 0$ mean absence of the event at time $|t_i|$.

Predictions $a_i$ are hazard rates.

**Usage information**  See [more](#usage-information).

**User-defined parameters**

No.

### SurvivalAft {#SurvivalAft}

$\displaystyle\sum\limits_{t_{i,0} = t_{i,1}} \log\left(f(\epsilon(t_{i,0}, a_i)\right) + \sum\limits_{t_{i,0} \ne t_{i,1}} \log \left(F(\epsilon(t_{i,1}, a_i)) - F(\epsilon(t_{i,0}, a_i))\right)$

Observation interval is $[t_{i,0}, t_{i,1}]$ for $t_{i,1} \ne -1$, and $[t_{i,0}, \infty)$ for $t_{i,1} = -1$.

Predictions $a_i$ are hazard rates.

Helper $\epsilon(t, a) = (\log t - a)/\sigma$ for $t \ne -1$, and $\epsilon(-1, a) = \infty$, is hazard prediction error.

Coefficient $\sigma$ is scale of hazard prediction error, specified by `scale` parameter.

Functions $f$ and $F$ are probability density and cumulative distribution, specified by `dist` parameter.

{% cut "dist" %}

Guessed distribution of hazard prediction error.

Possible values: `Normal`, `Extreme`, `Logistic`.

| `dist` | $F$ | $f$ |
| --- | --- | --- |
| `Normal` | $\displaystyle\frac{1}{2}\left(1+\text{erf}\left( \frac{z}{\sqrt{2}}\right)\right)$ | $\displaystyle\frac{e^{-z^2/2}}{\sqrt{2\pi}}$|
| `Logistic` | $\displaystyle\frac{e^z}{1+e^z}$ | $\displaystyle\frac{e^z}{(1+e^z)^2}$ |
| `Extreme` | $\displaystyle 1-e^{-e^z}$ | $\displaystyle e^ze^{-e^z}$  |

_Default:_ `Normal`

{% endcut %}

{% cut "scale" %}

Scale of hazard prediction error.

_Default:_ 1.0

{% endcut %}


**Usage information**  See [more](#usage-information).

**User-defined parameters**

No.


## Used for optimization {#usage-information}

| Name                                                            | Optimization            | GPU Support             |
------------------------------------------------------------------|-------------------------|-------------------------|
[MAE](#MAE)                                 |     +                   |     +                   |
[MAPE](#MAPE)                               |     +                   |     +                   |
[Poisson](#Poisson)                         |     +                   |     +                   |
[Quantile](#Quantile)                       |     +                   |     +                   |
[MultiQuantile](#MultiQuantile)             |     +                   |     -                   |
[RMSE](#RMSE)                               |     +                   |     +                   |
[RMSEWithUncertainty](#RMSEWithUncertainty)                       |     +                   |     +                   |
[LogLinQuantile](#LogLinQuantile)           |     +                   |     +                   |
[Lq](#lq)                                   |     +                   |     +                   |
[Huber](#Huber)                             |     +                   |     +                   |
[Expectile](#Expectile)                     |     +                   |     +                   |
[Tweedie](#Tweedie)                         |     +                   |     +                   |
[LogCosh](#LogCosh)                         |     +                   |     -                   |
[Cox](#Cox)                                 |     +                   |     -                   |
[SurvivalAft](#SurvivalAft)                 |     +                   |     -                   |
[FairLoss](#FairLoss)                       |     -                   |     -                   |
[NumErrors](#NumErrors)                     |     -                   |     +                   |
[SMAPE](#SMAPE)                             |     -                   |     -                   |
[R2](#R2)                                   |     -                   |     -                   |
[MSLE](#MSLE)                               |     -                   |     -                   |
[MedianAbsoluteError](#MedianAbsoluteError) |     -                   |     -                   |
