---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier_eval-metrics.md
  - href: en/concepts/python-reference_catboostclassifier_eval-metrics.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# eval_metrics

<!-- source: en/_includes/work_src/reusage/python__eval-metrics__purpose.md -->
Calculate the specified metrics for the specified dataset.
<!-- endsource: en/_includes/work_src/reusage/python__eval-metrics__purpose.md -->


## Method call format {#call-format}

```python
eval_metrics(data,
             metrics,
             ntree_start=0,
             ntree_end=0,
             eval_period=1,
             thread_count=-1,
             log_cout=sys.stdout,
             log_cerr=sys.stderr)
```

## Parameters {#parameters}

<!-- source: en/_includes/work_src/reusage/python__eval-metrics__parameters.md -->
### data

#### Description

A file or matrix with the input dataset.

**Possible values**

catboost.Pool

**Default value**

Required parameter

### metrics

#### Description

The list of metrics to be calculated.
[Supported metrics](https://catboost.ai/docs/en/references/custom-metric__supported-metrics.md)
For example, if the AUC and Logloss metrics should be calculated, use the following construction:

```python
['Logloss', 'AUC']
```

**Possible values**

list of strings

**Default value**

Required parameter

### ntree_start

#### Description

To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)`.

<!-- source: en/_includes/work_src/reusage-common-phrases/ntree_start__short-param-desc.md -->
This parameter defines the index of the first tree to be used when applying the model or calculating the metrics (the inclusive left border of the range). Indices are zero-based.
<!-- endsource: en/_includes/work_src/reusage-common-phrases/ntree_start__short-param-desc.md -->

**Possible values**

int

**Default value**

0


### ntree_end

#### Description

To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the step of the trees to use to`eval_period`.

<!-- source: en/_includes/work_src/reusage-common-phrases/ntree_end__short-param-desc.md -->
This parameter defines the index of the first tree not to be used when applying the model or calculating the metrics (the exclusive right border of the range). Indices are zero-based.
<!-- endsource: en/_includes/work_src/reusage-common-phrases/ntree_end__short-param-desc.md -->

**Possible values**

int

**Default value**

0 (the index of the last tree to use equals to the number of trees in the
                    model minus one)

### eval_period

#### Description

To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the step of the trees to use to`eval_period`.


<!-- source: en/_includes/work_src/reusage-common-phrases/python_r__eval__period__desc.md -->
This parameter defines the step to iterate over the range `[`ntree_start`; `ntree_end`)`. For example, let's assume that the following parameter values are set:

- `ntree_start` is set 0
- `ntree_end` is set to N (the total tree count)
- `eval_period` is set to 2

In this case, the results are returned for the following tree ranges: `[0, 2)`, `[0, 4)`, ... , `[0, N)`.
<!-- endsource: en/_includes/work_src/reusage-common-phrases/python_r__eval__period__desc.md -->

**Possible values**

int

**Default value**

1 (the trees are applied sequentially: the first tree, then the first two
                    trees, etc.)


### thread_count

#### Description

<!-- source: en/_includes/work_src/reusage/thread-count-short-desc.md -->
The number of threads to use for operation.
<!-- endsource: en/_includes/work_src/reusage/thread-count-short-desc.md -->


<!-- source: en/_includes/work_src/reusage/thread_count__cpu_cores__optimizes-the-speed-of-execution.md -->
Optimizes the speed of execution. This parameter doesn't affect results.
<!-- endsource: en/_includes/work_src/reusage/thread_count__cpu_cores__optimizes-the-speed-of-execution.md -->

**Possible values**

int

**Default value**

-1 (the number of threads is equal to the number of processor cores)

<!-- source: en/_includes/work_src/reusage-python/python__log-params.md -->
###  log_cout

Output stream or callback for logging.

**Possible types**

- callable Python object
- python object providing the `write()` method

**Default value**

sys.stdout

###  log_cerr

Error stream or callback for logging.

**Possible types**

- callable Python object
- python object providing the `write()` method

**Default value**

sys.stderr
<!-- endsource: en/_includes/work_src/reusage-python/python__log-params.md -->
<!-- endsource: en/_includes/work_src/reusage/python__eval-metrics__parameters.md -->

## Type of return value {#output-format}

<!-- source: en/_includes/work_src/reusage/python__eval-metrics__return-value__div.md -->
A dictionary of calculated metrics in the following format:

```
metric -> array of shape [(ntree_end – ntree_start) / eval_period]
```
<!-- endsource: en/_includes/work_src/reusage/python__eval-metrics__return-value__div.md -->

