Metadata manipulation
The CatBoost models contain metadata (for example, the list of training parameters or user-defined data) in key-value format. Several operations are provided to manipulate the model's metadata.
Get values of the selected keys
Execution format
catboost metadata get -m <path to the model> --key '<>' .. --key '<>' [--dump-format <output format>]
Options
Output format
The format of the data that is output to stdout depends on the selected mode:
Each line of the output contains tab-separated data on the key and its' value:
key_1</t>value_1
key_2</t>value_2
...
key_N</t>value_N
model_name</t>catboost model
params</t>{"detailed_profile":true,"used_ram_limit":18446744073709551615}
A JSON array of metadata key-value pairs:
{"model_name":"value_1","key_2":"value_2",..,"key_N":"value_N"}
{"model_name":"catboost model","GUITARMAN3":"3","params":"{\"detailed_profile\":true,\"has_time\":false}"}
Get values of all keys
Execution format
catboost metadata dump -m <path to the model> [--dump-format <output format>]
Options
Option | Description | Default value |
---|---|---|
-m --model-file --model-path | The name of the input file with the description of the model obtained as the result of training. | Required key |
--dump-format | The output format. Possible values:
| Plain |
Option | Description | Default value |
---|---|---|
-m --model-file --model-path | The name of the input file with the description of the model obtained as the result of training. | Required key |
--dump-format | The output format. Possible values:
| Plain |
Output
The format of the data that is output to stdout depends on the selected mode:
Each line of the output contains tab-separated data on the key and its' value:
key_1</t>value_1
key_2</t>value_2
...
key_N</t>value_N
model_name</t>catboost model
params</t>{"detailed_profile":true,"used_ram_limit":18446744073709551615}
A JSON array of metadata key-value pairs:
{"model_name":"value_1","key_2":"value_2",..,"key_N":"value_N"}
{"model_name":"catboost model","GUITARMAN3":"3","params":"{\"detailed_profile\":true,\"has_time\":false}"}
Set a key-value pair
Execution format
catboost metadata set -m <path to the model> --key '<>' --value 'VALUE' []
Options
Option | Description | Default value |
---|---|---|
-m --model-file --model-path | The name of the input file with the description of the model obtained as the result of training. | Required key |
--key | The name of the key. | Required key |
--value | The value that the key should be set to. The given value overwrites existing data if the specified key matches an existing one. | Required key |
-o | The path to the output model. If defined, the key-value pair and the initial model's key-value pairs are written to the specified model and the input model is not affected by the operation. | Input model (the values of existing keys are overridden) |
Option | Description | Default value |
---|---|---|
-m --model-file --model-path | The name of the input file with the description of the model obtained as the result of training. | Required key |
--key | The name of the key. | Required key |
--value | The value that the key should be set to. The given value overwrites existing data if the specified key matches an existing one. | Required key |
-o | The path to the output model. If defined, the key-value pair and the initial model's key-value pairs are written to the specified model and the input model is not affected by the operation. | Input model (the values of existing keys are overridden) |