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

Function GetBinFeatureCombinationClassByDepth

catboost/libs/fstr/util.cpp:135–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135TVector<int> GetBinFeatureCombinationClassByDepth(
136 const TModelTrees& forest,
137 const TVector<int>& binFeatureCombinationClass,
138 size_t treeIdx
139) {
140 const size_t depthOfTree = forest.GetModelTreeData()->GetTreeSizes()[treeIdx];
141 TVector<int> binFeatureCombinationClassByDepth(depthOfTree);
142 for (size_t depth = 0; depth < depthOfTree; ++depth) {
143 const size_t remainingDepth = depthOfTree - depth - 1;
144 const int combinationClass = binFeatureCombinationClass[
145 forest.GetModelTreeData()->GetTreeSplits()[forest.GetModelTreeData()->GetTreeStartOffsets()[treeIdx] + remainingDepth]
146 ];
147 binFeatureCombinationClassByDepth[depth] = combinationClass;
148 }
149 return binFeatureCombinationClassByDepth;
150}
151
152EFeatureCalcerType GetEstimatedFeatureCalcerType(
153 const TFullModel& model,

Calls 3

GetTreeSizesMethod · 0.80
GetTreeSplitsMethod · 0.80
GetTreeStartOffsetsMethod · 0.80

Tested by

no test coverage detected