---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.5
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier_score.md
  - href: en/concepts/python-reference_catboostclassifier_score.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

# score

<!-- source: en/_includes/work_src/reusage-python/score__purpose.md -->
Calculate the Accuracy [metric](https://catboost.ai/docs/en/concepts/loss-functions.md) for the objects in the given dataset.
<!-- endsource: en/_includes/work_src/reusage-python/score__purpose.md -->


## Method call format {#call-format}

```
score(X, y)
```

## Parameters {#parameters}
### X

#### Description

The description is different for each group of possible types.

**Possible types**

{% cut "catboost.Pool" %}

The input training dataset.

{% note info %}

If a nontrivial value of the `cat_features` parameter is specified in the constructor of this class, CatBoost checks the equivalence of categorical features indices specification from the constructor parameters and in this Pool class.

{% endnote %}

{% endcut %}

{% cut "list, numpy.ndarray, pandas.DataFrame, pandas.Series, polars.DataFrame" %}

The input training dataset in the form of a two-dimensional feature matrix.

{% endcut %}

{% cut "pandas.SparseDataFrame, scipy.sparse.spmatrix (all subclasses except dia_matrix)" %}

<!-- source: en/_includes/work_src/reusage-formats/libsvm__desc.md -->
The input training dataset in the form of a two-dimensional sparse feature matrix.
<!-- endsource: en/_includes/work_src/reusage-formats/libsvm__desc.md -->

{% endcut %}

**Default value**

Required parameter


### y

#### Description

<!-- source: en/_includes/work_src/reusage/label--short-desc-evaluation.md -->
The target variables (in other words, the objects' label values) for the evaluation dataset.
<!-- endsource: en/_includes/work_src/reusage/label--short-desc-evaluation.md -->

<!-- source: en/_includes/work_src/reusage/label--detailed-desc-classification.md -->
Must be in the form of a one- or two- dimensional array. The type of data in the array depends on the machine learning task being solved:
- Binary classification
    One-dimensional array containing one of:

    * Booleans, integers or strings that represent the labels of the classes (only two unique values).
    * Numeric values.
        The interpretation of numeric values depends on the selected loss function:

        - Logloss — The value is considered a positive class if it is strictly greater than the value of the `target_border` training parameter. Otherwise, it is considered a negative class.
        - CrossEntropy — The value is interpreted as the probability that the dataset object belongs to the positive class. Possible values are in the range `[0; 1]`.

- Multiclassification — One-dimensional array of integers or strings that represent the labels of the classes.
- Multi label classification
    Two-dimensional array. The first index is for a label/class, the second index is for an object.

    Possible values depend on the selected loss function:

    * MultiLogloss — Only {0, 1} or {False, True} values are allowed that specify whether an object belongs to the class corresponding to the first index.
    * MultiCrossEntropy — Numerical values in the range `[0; 1]` that are interpreted as the probability that the dataset object belongs to the class corresponding to the first index.
<!-- endsource: en/_includes/work_src/reusage/label--detailed-desc-classification.md -->

{% note info %}

Do not use this parameter if the input training dataset (specified in the `X` parameter) type is catboost.Pool.

{% endnote %}

<!-- source: en/_includes/work_src/reusage/label--possible-types-default-supported-processing-units.md -->
**Possible types**

- list
- numpy.ndarray
- pandas.DataFrame
- pandas.Series
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html)

**Default value**

None

**Supported processing units**

CPU and GPU
<!-- endsource: en/_includes/work_src/reusage/label--possible-types-default-supported-processing-units.md -->

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

float
