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

<!-- source: en/concepts/python-reference_catboost_attributes.md -->
# Attributes

## tree_count_ {#tree_count_}

#### Purpose

Return the number of trees in the model.

This number can differ from the value specified in the `--iterations` training parameter in the following cases:
- The training is stopped by the [overfitting detector](https://catboost.ai/docs/en/concepts/overfitting-detector.md).
- The `--use-best-model` training parameter is set to <q>True</q>.

#### Type
int


## feature_importances_ {#feature_importances_}

#### Purpose

Return the calculated [feature importances](https://catboost.ai/docs/en/concepts/fstr.md). The output data depends on the type of the model's loss function:
- Non-ranking loss functions — [PredictionValuesChange](https://catboost.ai/docs/en/concepts/fstr.md#regular-feature-importance)
- Ranking loss functions — [LossFunctionChange](https://catboost.ai/docs/en/concepts/fstr.md#regular-feature-importances__lossfunctionchange)

If the corresponding feature importance is not calculated the returned value is <q>None</q>.

Use the `get_feature_importance` function to surely calculate the [LossFunctionChange](https://catboost.ai/docs/en/concepts/fstr.md#regular-feature-importances__lossfunctionchange) feature importance.

#### Type
numpy.ndarray


## random_seed_ {#random_seed_}

#### Purpose

The random seed used for training.

#### Type

int


## learning_rate_ {#learning_rate_}

#### Purpose

The learning rate used for training.

#### Type
float


## feature_names_ {#feature_names_}

#### Purpose

The names of features in the dataset.

#### Type
list


## evals_result_ {#eval_result_}

#### Purpose

Return the values of metrics calculated during the training.

{% note info %}

Only the values of calculated metrics are output. The following metrics are not calculated by default for the training dataset and therefore these metrics are not output:

- PFound
- YetiRank
- NDCG
- YetiRankPairwise
- AUC
- NormalizedGini
- FilteredDCG
- DCG

Use the `hints=skip_train~false` parameter to enable the calculation. See the [Enable, disable and configure metrics calculation](https://catboost.ai/docs/en/concepts/loss-functions.md#enable-disable-configure-metrics) section for more details.

{% endnote %}

#### Type

dict

Output format:
```
{pool_name: {metric_name_1-1: [value_1, value_2, .., value_N]}, .., {metric_name_1-M: [value_1, value_2, .., value_N]}}
```

For example:
```
{'learn': {'Logloss': [0.6720840012056274, 0.6476800666988386, 0.6284055381249782], 'AUC': [1.0, 1.0, 1.0], 'CrossEntropy': [0.6720840012056274, 0.6476800666988386, 0.6284055381249782]}}
```


## best_score_ {#best_score}

#### Purpose

<!-- source: en/_includes/work_src/reusage/python__method__get_best_score__desc.md -->
Return the best result for each metric calculated on each validation dataset.
<!-- endsource: en/_includes/work_src/reusage/python__method__get_best_score__desc.md -->


<!-- source: en/_includes/work_src/reusage/only-the-calculated-metrics-are-output.md -->
{% note info %}

Only the values of calculated metrics are output. The following metrics are not calculated by default for the training dataset and therefore these metrics are not output:

- PFound
- YetiRank
- NDCG
- YetiRankPairwise
- AUC
- NormalizedGini
- FilteredDCG
- DCG

Use the `hints=skip_train~false` parameter to enable the calculation. See the [Enable, disable and configure metrics calculation](https://catboost.ai/docs/en/concepts/loss-functions.md#enable-disable-configure-metrics) section for more details.

{% endnote %}
<!-- endsource: en/_includes/work_src/reusage/only-the-calculated-metrics-are-output.md -->

#### Type

dict

Output format:
```bash
{pool_name_1: {metric_1: value,..., metric_N: value}, ..., pool_name_M: {metric_1: value,..., metric_N: value}
```

For example:
```bash
{'validation': {'Logloss': 0.6085537606941837, 'AUC': 0.0}}
```


## best_iteration_ {#best_iteration}

#### Purpose

<!-- source: en/_includes/work_src/reusage/python__method__get_best_iteration__desc.md -->
Return the identifier of the iteration with the best result of the evaluation metric or loss function on the last validation set.
<!-- endsource: en/_includes/work_src/reusage/python__method__get_best_iteration__desc.md -->


#### Type

int or None if the validation dataset is not specified.


## classes_ {#classes}

#### Purpose

Return the names of classes for classification models. An empty list is returned for all other models.

The order of classes in this list corresponds to the order of classes in resulting predictions.

#### Type
list (an empty list is returned for non-multiclassification models)
<!-- endsource: en/concepts/python-reference_catboost_attributes.md -->