ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier_score |
| Last Crawled | 2026-04-06 22:51:22 (16 hours ago) |
| First Indexed | 2024-11-18 16:12:15 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | score | CatBoost |
| Meta Description | Calculate the Accuracy metric for the objects in the given dataset. Method call format. score(X, y). Parameters X Description. |
| Meta Canonical | null |
| Boilerpipe Text | Calculate the Accuracy
metric
for the objects in the given dataset.
Method call format
score(X, y)
Parameters
X
Description
The description is different for each group of possible types.
Possible types
catboost.Pool
The input training dataset.
Note
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.
list, numpy.ndarray, pandas.DataFrame, pandas.Series, polars.DataFrame
The input training dataset in the form of a two-dimensional feature matrix.
pandas.SparseDataFrame, scipy.sparse.spmatrix (all subclasses except dia_matrix)
The input training dataset in the form of a two-dimensional sparse feature matrix.
Default value
Required parameter
y
Description
The target variables (in other words, the objects' label values) for the evaluation dataset.
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.
Note
Do not use this parameter if the input training dataset (specified in the
X
parameter) type is catboost.Pool.
Possible types
list
numpy.ndarray
pandas.DataFrame
pandas.Series
polars.Series
polars.DataFrame
Default value
None
Supported processing units
CPU and GPU
Type of return value
float |
| Markdown | [](https://catboost.ai/ "CatBoost")
- Installation
- [Overview](https://catboost.ai/docs/en/concepts/en/concepts/installation)
- Python package installation
- CatBoost for Apache Spark installation
- R package installation
- Command-line version binary
- Build from source
- Key Features
- Training parameters
- Python package
- [Quick start](https://catboost.ai/docs/en/concepts/en/concepts/python-quickstart)
- CatBoost
- CatBoostClassifier
- [Overview](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier)
- [fit](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_fit)
- [predict](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_predict)
- [predict\_proba](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_predict_proba)
- [Attributes](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_attributes)
- [calc\_leaf\_indexes](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboost_calc_leaf_indexes)
- [calc\_feature\_statistics](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_calc_feature_statistics)
- [compare](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_modelcompare)
- [copy](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_copy)
- [eval\_metrics](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_eval-metrics)
- [get\_all\_params](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_all_params)
- [get\_best\_iteration](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_best_iteration)
- [get\_best\_score](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_best_score)
- [get\_borders](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_borders)
- [get\_evals\_result](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_evals_result)
- [get\_feature\_importance](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_feature_importance)
- [get\_metadata](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_metadata)
- [get\_object\_importance](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_object_importance)
- [get\_param](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_param)
- [get\_params](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_params)
- [get\_probability\_threshold](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_probability_threshold)
- [get\_scale\_and\_bias](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_scale_and_bias)
- [get\_test\_eval](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_get_test_eval)
- [grid\_search](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_grid_search)
- [is\_fitted](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_is_fitted)
- [load\_model](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_load_model)
- [plot\_predictions](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_plot_predictions)
- [plot\_tree](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_plot_tree)
- [randomized\_search](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_randomized_search)
- [save\_borders](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_save_borders)
- [save\_model](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_save_model)
- [score](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score)
- [select\_features](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_select_features)
- [set\_feature\_names](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_set_feature_names)
- [set\_params](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_set_params)
- [set\_probability\_threshold](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_set_probability_threshold)
- [set\_scale\_and\_bias](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_set_scale_and_bias)
- [shrink](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_shrink)
- [staged\_predict](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_staged_predict)
- [staged\_predict\_proba](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_staged_predict_proba)
- CatBoostRanker
- CatBoostRegressor
- [cv](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_cv)
- datasets
- FeaturesData
- MetricVisualizer
- Pool
- [sample\_gaussian\_process](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_sample_gaussian_process)
- [sum\_models](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_sum_models)
- [to\_classifier](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_to_classifier)
- [to\_regressor](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_to_regressor)
- [train](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_train)
- Text processing
- utils
- [Usage examples](https://catboost.ai/docs/en/concepts/en/concepts/python-usages-examples)
- CatBoost for Apache Spark
- R package
- Command-line version
- Applying models
- Objectives and metrics
- Model analysis
- Data format description
- [Parameter tuning](https://catboost.ai/docs/en/concepts/en/concepts/parameter-tuning)
- [Speeding up the training](https://catboost.ai/docs/en/concepts/en/concepts/speed-up-training)
- Data visualization
- Algorithm details
- [FAQ](https://catboost.ai/docs/en/concepts/en/concepts/faq)
- Educational materials
- [Development and contributions](https://catboost.ai/docs/en/concepts/en/concepts/development-and-contributions)
- [Contacts](https://catboost.ai/docs/en/concepts/en/concepts/contacts)
score
## In this article:
- [Method call format](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#call-format)
- [Parameters](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#parameters)
- [X](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#x)
- [y](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#y)
- [Type of return value](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#output-format)
1. Python package
2. [CatBoostClassifier](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier)
3. score
# score
- [Method call format](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#call-format)
- [Parameters](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#parameters)
- [X](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#x)
- [y](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#y)
- [Type of return value](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_score#output-format)
Calculate the Accuracy [metric](https://catboost.ai/docs/en/concepts/en/concepts/loss-functions) for the objects in the given dataset.
## Method call format
```
score(X, y)
```
## Parameters
### X
#### Description
The description is different for each group of possible types.
**Possible types**
catboost.Pool
The input training dataset.
Note
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.
list, numpy.ndarray, pandas.DataFrame, pandas.Series, polars.DataFrame
The input training dataset in the form of a two-dimensional feature matrix.
pandas.SparseDataFrame, scipy.sparse.spmatrix (all subclasses except dia\_matrix)
The input training dataset in the form of a two-dimensional sparse feature matrix.
**Default value**
Required parameter
### y
#### Description
The target variables (in other words, the objects' label values) for the evaluation dataset.
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.
Note
Do not use this parameter if the input training dataset (specified in the `X` parameter) type is catboost.Pool.
**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
## Type of return value
float
### Was the article helpful?
Yes
No
Previous
[save\_model](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_save_model)
Next
[select\_features](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostclassifier_select_features)
 |
| Readable Markdown | Calculate the Accuracy [metric](https://catboost.ai/docs/en/concepts/loss-functions) for the objects in the given dataset.
## Method call format
```
score(X, y)
```
## Parameters
### X
#### Description
The description is different for each group of possible types.
**Possible types**
catboost.Pool
The input training dataset.
Note
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.
list, numpy.ndarray, pandas.DataFrame, pandas.Series, polars.DataFrame
The input training dataset in the form of a two-dimensional feature matrix.
pandas.SparseDataFrame, scipy.sparse.spmatrix (all subclasses except dia\_matrix)
The input training dataset in the form of a two-dimensional sparse feature matrix.
**Default value**
Required parameter
### y
#### Description
The target variables (in other words, the objects' label values) for the evaluation dataset.
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.
Note
Do not use this parameter if the input training dataset (specified in the `X` parameter) type is catboost.Pool.
**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
## Type of return value
float |
| Shard | 169 (laksa) |
| Root Hash | 17435841955170310369 |
| Unparsed URL | ai,catboost!/docs/en/concepts/python-reference_catboostclassifier_score s443 |