CatBoost is an open-source gradient-boosting library built for datasets containing categorical features such as demographic groups, states, or high-cardinality ZIP codes. It combines categorical encoding and ensemble training instead of requiring a separate encode-then-model pipeline. section 8.0 section 8.3.4
Its central design choices address common problems in categorical boosting:
- Computes ordered target statistics by randomly permuting training examples and using only preceding examples to encode each categorical value. section 8.2.1
- Uses ordered boosting to compute gradients from preceding examples, reducing prediction shift caused by repeatedly reusing training data. section 8.2.1
- Creates categorical combinations and encodes them with target statistics, supporting complex categorical relationships. section 8.2.1
- Uses oblivious decision trees as base estimators, which can lead to faster training. section 8.2
Training and tuning a classifier
A CatBoostClassifier can receive categorical column names directly, train on a train/test split, and predict without separate categorical preprocessing. Cross-validation can search depth, iterations, and learning_rate; early stopping can monitor an evaluation Pool and stop when validation performance begins to overfit. On the Australian Credit Approval dataset, a simple example reported 83.333% accuracy, while a tuned or early-stopped run reported 82.609%. section 8.2.3
Figure 8.8 Ordered target statistics first permutes the examples into a random sequence, using only the previous examples in the ordered sequence to compute the target statistics.
Trace the permutation-based calculation of ordered target statistics step by step. section 8.2.1
Figure 8.9 Ordered boosting also permutes the examples into a random sequence and uses only the previous examples in the ordered sequence to compute the gradients (residuals). Shown here is how the residuals are computed at iteration 4 (using estimator M4 for example x2), at iteration 5 (using estimator M5 for example x6), and so on.
Follow how ordered boosting uses preceding examples to compute residuals during successive iterations. section 8.2.1
