Calculate metrics

Purpose

Calculate metrics for a given dataset using a previously trained model.

Execution format

catboost eval-metrics --metrics <comma-separated list of metrics> [optional parameters]

Options

-m, --model-file, --model-path

Description

The name of the input file with the description of the model obtained as the result of training.

Default value

model.bin

--model-format

Description

The format of the input model.

Possible values:

  • CatboostBinary.
  • AppleCoreML (only datasets without categorical features are currently supported).
  • json (multiclassification models are not currently supported). Refer to the CatBoost JSON model tutorial for format details.

Default value

CatboostBinary

--input-path

Description

The name of the input file with the dataset description.

Default value

input.tsv

--column-description, --cd

Description

The path to the input file that contains the columns description.

Default value

If omitted, it is assumed that the first column in the file with the dataset description defines the label value, and the other columns are the values of numerical features.

--input-pairs

Description

The path to the input file that contains the pairs description for the dataset.

This information is used for the calculation of Pairwise metrics.

Default value

Omitted

Pairwise metrics require pairs of data. If this data is not provided explicitly by specifying this parameter, pairs are generated automatically in each group using object label values

-o, --output-path

Description

The path to the output file with calculated metrics.

Default value

output.tsv

-T, --thread-count

Description

The number of threads to calculate metrics.

Optimizes the speed of execution. This parameter doesn't affect results.

Default value

The number of processor cores

--delimiter

Description

The delimiter character used to separate the data in the dataset description input file.

Only single char delimiters are supported. If the specified value contains more than one character, only the first one is used.

Note

Used only if the dataset is given in the Delimiter-separated values format.

Default value

The input data is assumed to be tab-separated

--has-header

Description

False (the first line is supposed to have the same data as the rest of them)

Default value

False (the first line is supposed to have the same data as the rest of them)

--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) and the step of the trees to use to --eval-period.

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.

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.

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.

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.

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).

Default value

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

--metrics

Description

A comma-separated list of metrics to be calculated.

Possible values

For example, if the AUC and Logloss metrics should be calculated, use the following construction:

--metrics AUC,Logloss

Default value

Required parameter

--result-dir

Description

The directory for storing the files generated during metric calculation.

Default value

None (current directory)

--tmp-dir

Description

The directory for storing temporary files that are generated if non-additive metrics are calculated.

By default, the directory is generated inside the current one at the start of calculation, and it is removed when the calculation is complete. Otherwise the specified value is used.

Default value

(the directory is generated)

--verbose

Description

Verbose output to stdout.

Default value

False