CatBoost¶
The Snowflake ML Model Registry supports models created using CatBoost (models derived from catboost.CatBoost, such as
catboost.CatBoostClassifier, catboost.CatBoostRegressor, and catboost.CatBoostRanker).
The following additional options can be used in the options dictionary when you call log_model:
Option |
Description |
|---|---|
|
A list of the names of the methods available on the model object. CatBoost models have the following target methods by default, assuming the method exists:
|
|
Whether to enable explainability for the model using SHAP. Defaults to |
|
The version of the CUDA runtime to be used when deploying to a platform with GPU; defaults to 11.8. If manually set
to |
You must specify either the sample_input_data or signatures parameter when logging a CatBoost model so
that the registry knows the signatures of the target methods.
Examples¶
These examples assume reg is an instance of snowflake.ml.registry.Registry.
CatBoostClassifier¶
The following example demonstrates the key steps to train a CatBoost classifier, log it to the Snowflake ML Model Registry, and use the registered model for inference and explainability. The workflow includes:
Trains a CatBoost classifier on a sample dataset.
Logs the model to the Snowflake ML Model Registry.
Makes predictions and retrieves prediction probabilities.
Gets SHAP values for the model’s predictions.
CatBoostRegressor¶
The following example demonstrates the key steps to train a CatBoost regressor, log it to the Snowflake ML Model Registry, and use the registered model for inference. The workflow includes:
Trains a CatBoost regressor on a sample dataset.
Logs the model to the Snowflake ML Model Registry.
Makes predictions.
Disabling Explainability¶
If you do not need explainability features, you can disable them during logging to reduce model size and dependencies: