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

Function ExtractBucketIndex

catboost/private/libs/algo/leafwise_scoring.cpp:100–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99template <class TColumn, typename TBucketIndexType>
100inline static void ExtractBucketIndex(
101 const TCalcScoreFold& fold,
102 const TColumn& column,
103 bool isEstimatedData,
104 bool isOnlineData,
105 TIndexRange<ui32> docIndexRange,
106 int groupSize,
107 const TVector<ui32>& groupPartsBucketsOffsets,
108 TVector<TBucketIndexType>* bucketIdx // already of proper size
109) {
110 if (const auto* denseColumnData
111 = dynamic_cast<const TCompressedValuesHolderImpl<TColumn>*>(&column))
112 {
113 const ui32* objectIndexing;
114 int beginOffset;
115 GetIndexingParams(fold, isEstimatedData, isOnlineData, &objectIndexing, &beginOffset);
116
117 const TCompressedArray& compressedArray = *denseColumnData->GetCompressedData().GetSrc();
118
119 compressedArray.DispatchBitsPerKeyToDataType(
120 "ExtractBucketIndex",
121 [&] (const auto* columnData) {
122 SetBucketIndex(
123 columnData,
124 objectIndexing,
125 beginOffset,
126 docIndexRange,
127 groupSize,
128 groupPartsBucketsOffsets,
129 bucketIdx
130 );
131 }
132 );
133 } else {
134 CB_ENSURE(false, "ExtractBucketIndex: unexpected column type");
135 }
136}
137
138
139// Calculate index of leaf for each document given a new split ensemble.

Callers 1

Calls 10

SetBucketIndexFunction · 0.85
GetSrcMethod · 0.80
GetCompressedDataMethod · 0.80
IsSplitOfTypeMethod · 0.80
GetIndexingParamsFunction · 0.70
dataMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected