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

# save_model

<!-- source: en/_includes/work_src/reusage/save_model--purpose.md -->
Save the model to a file.
<!-- endsource: en/_includes/work_src/reusage/save_model--purpose.md -->


## Method call format {#call-format}

```
save_model(fname,
           format="cbm",
           export_parameters=None,
           pool=None)
```

## Parameters {#parameters}

<!-- source: en/_includes/work_src/reusage/python__save-model__full.md -->
### fname

#### Description

The path to the output model.

**Possible types**

string

**Default value**

Required parameter

### format

#### Description

The output format of the model.

<!-- source: en/_includes/work_src/reusage/python__exporting-models__format.md -->
Possible values:
- cbm — CatBoost binary format.
- coreml — Apple CoreML format (only datasets without categorical features are currently supported).
- json — JSON format. Refer to the [CatBoost JSON model tutorial](https://github.com/catboost/tutorials/blob/master/model_analysis/model_export_as_json_tutorial.ipynb) for format details.
- python — Standalone Python code. See the [Python](https://catboost.ai/docs/en/concepts/python-reference_apply_catboost_model.md) section for details on applying the resulting model.
- cpp — Standalone C++ code. See the [C++](https://catboost.ai/docs/en/concepts/c-plus-plus-api_applycatboostmodel.md) section for details on applying the resulting model.
- onnx — ONNX-ML format (only datasets without categorical features are currently supported). Refer to [https://onnx.ai/](https://onnx.ai/) for details. See the [ONNX](https://catboost.ai/docs/en/concepts/apply-onnx-ml.md) section for details on applying the resulting model.
- <!-- source: en/_includes/work_src/reusage/cli__export-model-formats__pmml__p.md -->
  pmml — [PMML version 4.3](http://dmg.org/pmml/pmml-v4-3.html) format. Categorical features must be interpreted as one-hot encoded during the training if present in the training dataset. This can be accomplished by setting the `--one-hot-max-size`/`one_hot_max_size` parameter to a value that is greater than the maximum number of unique categorical feature values among all categorical features in the dataset. See the [PMML](https://catboost.ai/docs/en/concepts/apply-pmml.md) section for details on applying the resulting model.
  <!-- endsource: en/_includes/work_src/reusage/cli__export-model-formats__pmml__p.md -->

    {% note info %}

    Multiclassification models are not currently supported.

    {% endnote %}
<!-- endsource: en/_includes/work_src/reusage/python__exporting-models__format.md -->

**Possible types**

string

**Default value**

cbm

### export_parameters

#### Description

Additional format-dependent parameters for:

- Apple CoreML

    Possible values (all are strings):

    - `prediction_type`. Possible values are <q>probability </q>and <q>raw</q>.

    - `coreml_description`

    - `coreml_model_version`

    - `coreml_model_author`

    - `coreml_model_license`


- ONNX-ML

    <!-- source: en/_includes/work_src/reusage-export-formats/additional-parameters__onnx-model__possible-values__list-only.md -->
    - `onnx_graph_name`
    - `onnx_domain`
    - `onnx_model_version`
    - `onnx_doc_string`
    <!-- endsource: en/_includes/work_src/reusage-export-formats/additional-parameters__onnx-model__possible-values__list-only.md -->

    See the [ONNX-ML parameters](https://catboost.ai/docs/en/references/onnx-parameters.md) reference for details.


- PMML

    Possible values (all are strings):

    <!-- source: en/_includes/work_src/reusage-export-formats/additional-parameters__pmml__possible-values__list-only.md -->
    - `pmml_copyright`
    - `pmml_description`
    - `pmml_model_version`
    <!-- endsource: en/_includes/work_src/reusage-export-formats/additional-parameters__pmml__possible-values__list-only.md -->

    See the [PMML parameters](https://catboost.ai/docs/en/references/pmml-parameters.md) reference for details.



**Possible types**

dict

**Default value**

None

### pool

#### Description

The dataset previously used for training.

This parameter is required if the model contains categorical features and the output format is cpp, python, or JSON.

{% note info %}

The model can be saved to the JSON format without a pool. In this case it is available for review but it is not applicable.

{% endnote %}

**Possible types**

- catboost.Pool
- list
- numpy.ndarray
- pandas.DataFrame
- pandas.Series
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html)
- catboost.FeaturesData

**Default value**
None
<!-- endsource: en/_includes/work_src/reusage/python__save-model__full.md -->


### Related information

- [Python](https://catboost.ai/docs/en/concepts/python-reference_apply_catboost_model.md#python-reference_apply_catboost_model)
- [C++](https://catboost.ai/docs/en/concepts/c-plus-plus-api_applycatboostmodel.md#c-plus-plus-api_applycatboostmodel)
- [CoreML](https://catboost.ai/docs/en/concepts/export-coreml.md#export-coreml)
- [ONNX](https://catboost.ai/docs/en/concepts/apply-onnx-ml.md#apply-onnx-ml)
- [Export a model to JSON](https://catboost.ai/docs/en/features/export-model-to-json.md#export-model-to-json)
