sum_models

Purpose

Blend trees and counters of two or more trained CatBoost models into a new model. Leaf values can be individually weighted for each input model. For example, it may be useful to blend models trained on different validation datasets.

Method call format

sum_models(models, 
           weights=None, 
           ctr_merge_policy='IntersectingCountersAverage')

Parameters

Parameter Possible values Description Default value
models list of CatBoost models

A list of models to blend.

Required parameter
weights list of numbers

A list of weights for the leaf values of each model. The length of this list must be equal to the number of blended models.

А list of weights equal to “1.0/N” for N blended models gives the average prediction. For example, the following list of weights gives the average prediction for four blended models:
[0.25,0.25,0.25,0.25]
None (leaf values weights are set to 1 for all models)
ctr_merge_policy string The counters merging policy. Possible values:
  • FailIfCtrsIntersects — Ensure that the models have zero intersecting counters.
  • LeaveMostDiversifiedTable — Use the most diversified counters by the count of unique hash values.
  • IntersectingCountersAverage — Use the average ctr counter values in the intersecting bins.
IntersectingCountersAverage
Parameter Possible values Description Default value
models list of CatBoost models

A list of models to blend.

Required parameter
weights list of numbers

A list of weights for the leaf values of each model. The length of this list must be equal to the number of blended models.

А list of weights equal to “1.0/N” for N blended models gives the average prediction. For example, the following list of weights gives the average prediction for four blended models:
[0.25,0.25,0.25,0.25]
None (leaf values weights are set to 1 for all models)