---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_save_quantization_borders.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# save_quantization_borders

<!-- source: en/_includes/work_src/reusage-python/pool__save_quantization_borders_div.md -->
Save borders used in the numeric features' quantization to a file.

Refer to the [Custom quantization borders and missing value modes](https://catboost.ai/docs/en/concepts/input-data_custom-borders.md) section for details on the output file's format.
<!-- endsource: en/_includes/work_src/reusage-python/pool__save_quantization_borders_div.md -->

## Method call format {#call-format}

```python
save_quantization_borders(output_file)
```

## Parameters {#parameters}

### output_file

#### Description

The name of the output file to save borders used in the numeric features' quantization to.

<!-- source: en/_includes/work_src/reusage-python/pool__save_quantization_borders_ref_to_format.md -->
Refer to the [Custom quantization borders and missing value modes](https://catboost.ai/docs/en/concepts/input-data_custom-borders.md) section for details on the output file's format.
<!-- endsource: en/_includes/work_src/reusage-python/pool__save_quantization_borders_ref_to_format.md -->

**Possible types**

string

**Default value**

Required parameter

## Example {#example}

The following example shows how to save borders used in numeric features' quantization in the training dataset to a file (`borders.dat`) and then use them for the evaluation dataset.

```python
from catboost import Pool, CatBoostRegressor

train_data = [[1, 4, 5, 6],
              [4, 5, 6, 7],
              [30, 40, 50, 60]]

train_labels = [10, 20, 30]

eval_data = [[2, 4, 6, 8],
             [1, 4, 50, 60]]

eval_labels = [20, 30]

train_dataset = Pool(train_data, train_labels)
eval_dataset = Pool(eval_data, eval_labels)

train_dataset.quantize()
train_dataset.save_quantization_borders("borders.dat")
eval_dataset.quantize(input_borders="borders.dat")
```

Contents of the output `borders.dat` file:
```no-highlight
0	2.5
0	17
1	4.5
1	22.5
2	5.5
2	28
3	6.5
3	33.5
```
