MCPcopy Create free account
hub / github.com/catboost/catboost / shrink

Method shrink

catboost/python-package/catboost/core.py:3681–3694  ·  view source on GitHub ↗

Shrink the model. Parameters ---------- ntree_end: int Leave the trees with indices from the interval [ntree_start, ntree_end) (zero-based indexing). ntree_start: int, optional (default=0) Leave the trees with indices from the interva

(self, ntree_end, ntree_start=0)

Source from the content-addressed store, hash-verified

3679 return result
3680
3681 def shrink(self, ntree_end, ntree_start=0):
3682 """
3683 Shrink the model.
3684
3685 Parameters
3686 ----------
3687 ntree_end: int
3688 Leave the trees with indices from the interval [ntree_start, ntree_end) (zero-based indexing).
3689 ntree_start: int, optional (default=0)
3690 Leave the trees with indices from the interval [ntree_start, ntree_end) (zero-based indexing).
3691 """
3692 if ntree_start > ntree_end:
3693 raise CatBoostError("ntree_start should be less than ntree_end.")
3694 self._base_shrink(ntree_start, ntree_end)
3695
3696 def drop_unused_features(self):
3697 """

Callers 5

model_no_treesMethod · 0.95
test_shrinkFunction · 0.45
test_shrink_with_biasFunction · 0.45
test_grow_policy_failsFunction · 0.45

Calls 2

_base_shrinkMethod · 0.80
CatBoostErrorClass · 0.50

Tested by 5

model_no_treesMethod · 0.76
test_shrinkFunction · 0.36
test_shrink_with_biasFunction · 0.36
test_grow_policy_failsFunction · 0.36