Export a model to Python or C++
The CatBoost model can be saved as standalone Python or C++ code. This solution simplifies the integration of resulting models to Python and C++ applications, allows to port models to architectures that are not directly supported by CatBoost (such as ARM) and allows advanced users to manually explore or edit the model parameters.
Choose the implementation for more details.
Depending on the output format the resulting file contains one of the following methods for applying the model:
- Python — apply_catboost_model
- C++ — C++
Multiclassification models are not currently supported.
apply_catboost_modelmethod is inferior in performance compared to the native CatBoost application methods, especially on large models and datasets.
The following parameters can be set for the corresponding methods and are used when the model is saved:
The output format of the model.
Set the value of this parameter to “python” or “cpp”.
The following command keys can be specified for the corresponding commands and are used when the model is trained:
Command catboost fit
A comma-separated list of output model formats.
Set the value of this key to “Python” or “CPP”.