get_best_score

Return the best result for each metric calculated on each validation dataset.

Method call format

get_best_score()

Type of return value

dict

Output format:

{pool_name_1: {metric_1: value,..., metric_N: value}, ..., pool_name_M: {metric_1: value,..., metric_N: value}

For example:

{'validation': {'Logloss': 0.6085537606941837, 'AUC': 0.0}}

Usage examples

from catboost import CatBoostClassifier, Pool

train_data = [[0, 3],
              [4, 1],
              [8, 1],
              [9, 1]]

train_labels = [0, 0, 1, 1]

eval_data = [[2, 1],
             [3, 1],
             [9, 0],
             [5, 3]]

eval_labels = [0, 1, 1, 0]

eval_dataset = Pool(eval_data,
                    eval_labels)

model = CatBoostClassifier(learning_rate=0.03,
                           custom_metric=['Logloss',
                                          'AUC:hints=skip_train~false'])

model.fit(train_data,
          train_labels,
          eval_set=eval_dataset,
          verbose=False)

print(model.get_best_score())

Note

This example illustrates the usage of the method with theĀ CatBoostClassifier class. The usage with other classes is identical.