CatBoost

Machine Learning
Introduced by
Prokhorenkova, L. et al. (Yandex)
Year
2018
Type
Gradient boosting on decision trees

What does it do?

CatBoost is a gradient boosting algorithm introduced by Prokhorenkova and colleagues in 2017 as an arXiv preprint and presented at NeurIPS 2018.

It handles categorical variables natively and uses ordered target statistics to reduce the target leakage that biases ordinary target encoding. The original paper reports that it outperforms other publicly available boosting implementations in quality across a variety of datasets.

The intuition behind the method

Many boosting implementations require categorical features to be converted to numbers before training, and a naive target encoding leaks each row's label into its own predictor. CatBoost computes each row's category encoding only from the observations that precede it in a randomly permuted order, so the row's own target does not influence its encoding. The original paper attributes its gains to this treatment of categorical features together with ordered boosting, which targets the same leakage problem during the boosting steps.

History

CatBoost was introduced by Liudmila Prokhorenkova and colleagues. It first appeared as an arXiv preprint in 2017 and was presented in the paper 'CatBoost: Unbiased Boosting with Categorical Features' at NeurIPS 2018. The paper frames its two main contributions, ordered boosting and an algorithm for categorical features, as responses to a prediction shift caused by target leakage present in gradient boosting implementations.

When to use it

CatBoost is a reasonable choice for classification and prediction on tabular data in which categorical features are a substantial part of the predictors, since this is the setting the original method was designed for. It is not designed for unstructured inputs such as raw images or free text, and it is a weaker choice when the dataset has very few observations. With small samples, categorical target statistics and validation-based tuning become noisy, so simpler baselines such as logistic regression or a single decision tree are a safer starting point. Hyperparameters such as tree depth, learning rate, and number of iterations should be tuned on a held-out validation set rather than left at defaults. If the data have few or no categorical features, other gradient boosting implementations are an equally sensible comparison.

Limitations and considerations

  • With very small samples, the ordered encodings are computed from few preceding rows, so they are noisy and the model is more prone to overfitting.
  • Tuning depth, learning rate, and iterations needs enough validation data to distinguish configurations, which small samples lack.
  • As a boosted-tree ensemble it has no explicit coefficients, so the effect of an individual feature is not directly readable as in logistic regression.
  • The reported advantage comes from combining ordered boosting with the categorical-feature algorithm. How large the gain is on data with few categorical features is not established by the source, so it should be checked by benchmarking.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Native handling of categorical features through cat_features, so manual one-hot encoding is not needed.
  • Ordered target statistics are designed to avoid the label leakage that biases ordinary target encoding.
  • Ordered boosting addresses the prediction shift caused by target leakage in standard gradient boosting.
  • The original paper reports better quality than other publicly available boosting implementations across a variety of datasets.

Applications

  • Classification and prediction on tabular datasets with many categorical features.
  • Modelling datasets where category columns would otherwise require large one-hot expansions.
  • Benchmarking against other gradient boosting implementations such as XGBoost and LightGBM on tabular data.

How it works

How it works

1

Categorical variables can be passed directly as cat_features, so manual one-hot encoding is not required. CatBoost converts each category into a numeric target statistic during training, which avoids expanding a high-cardinality column into many sparse indicator columns. The encoding for each row uses only earlier observations in the permutation, which is designed to prevent the label leakage of naive target encoding.

2

At each iteration the training data are permuted, and the gradient for each example is computed without using that example's own label. The original paper presents this permutation-driven alternative to classic boosting as a way to reduce the prediction shift caused by target leakage in standard gradient boosting implementations.

3

The ensemble grows additively: each new tree h_m is fitted to the current gradient information and added to the model as F_m(x) = F_{m-1}(x) + η·h_m(x), where η is the learning rate. This displayed update is the generic additive form used in gradient boosting. CatBoost applies it with symmetric (oblivious) trees, in which the same split condition is used across all nodes of a given level, which constrains the tree structure.

Formula
F_{m}(x) = F_{m-1}(x) + \eta\, h_m(x)

Common pitfalls

  • Running it on very small datasets, where categorical target statistics and validation-based tuning are noisy.
  • One-hot encoding categorical columns manually instead of passing them as cat_features, which discards the built-in encoding.
  • Tuning hyperparameters with too little validation data, so the chosen settings reflect noise.
  • Expecting a clear advantage over other boosting implementations on data without categorical features.

Frequently asked questions

Do I need to one-hot encode categorical variables?

No. When you mark columns as cat_features, CatBoost converts each category into a numeric target statistic during training, so manual one-hot encoding is unnecessary.

What is ordered boosting?

At each iteration CatBoost permutes the data order so that each example's gradient is computed without using its own label. The original paper presents this as a way to reduce the prediction shift caused by target leakage in standard gradient boosting.

How does CatBoost compare to XGBoost and LightGBM?

The original paper reports better quality than other publicly available boosting implementations across a variety of datasets. The paper ties this result to the combination of ordered boosting and its categorical-feature algorithm. The size of the advantage on data with few categorical features is not established by the source, so benchmark directly on your data.

How much data and tuning does it need?

With very small samples, the categorical target statistics and validation-based tuning become noisy. In that case simpler baselines such as logistic regression or a single decision tree are a safer comparison, and cross-validation helps judge stability. Tune depth, learning rate, and number of iterations on a validation set rather than relying on defaults.

How do I read CatBoost's output?

For classification, CatBoost returns predicted class probabilities, and for regression it returns predicted values. Feature importance is a model-based score that ranks how much each feature contributes to the fitted trees. It is not a significance test, so it should not be read as evidence that a feature has a real effect.

How can I explain individual predictions?

Post-hoc explainers can be applied to CatBoost's tree models. SHAP and ELI5 both support tree models such as CatBoost. In a credit-risk study, SHAP was used to identify the most important features of a CatBoost model, and ELI5 lists CatBoost among the tree models it can explain.

Related methods

Sources

  1. Prokhorenkova, L., Gusev, G., Vorobev, A., Dorogush, A.V. & Gulin, A. (2018). CatBoost: Unbiased Boosting with Categorical Features. In NeurIPS 2018.

    Open DOI reference
  2. Intelligent-and-Fuzzy-Systems, pp. 219, 225