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

Method GetBorders

catboost/cuda/methods/tree_ctrs.cpp:33–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33NCatboostCuda::TTreeCtrDataSetBuilder::TConstVec NCatboostCuda::TTreeCtrDataSetBuilder::GetBorders(const NCatboostCuda::TCtr& ctr,
34 const NCatboostCuda::TTreeCtrDataSetBuilder::TVec& floatCtr,
35 ui32 stream) {
36 CB_ENSURE(TreeCtrDataSet.InverseCtrIndex.contains(ctr));
37 const ui32 featureId = TreeCtrDataSet.InverseCtrIndex[ctr];
38 const auto& bordersSlice = TreeCtrDataSet.CtrBorderSlices[featureId];
39
40 if (TreeCtrDataSet.AreCtrBordersComputed[featureId] == false) {
41 const auto& binarizationDescription = TreeCtrDataSet.FeaturesManager.GetCtrBinarization(ctr);
42 TCudaBuffer<float, NCudaLib::TSingleMapping> bordersVecSlice = TreeCtrDataSet.CtrBorders.SliceView(bordersSlice);
43 ComputeCtrBorders(floatCtr,
44 binarizationDescription,
45 stream,
46 bordersVecSlice);
47 TreeCtrDataSet.AreCtrBordersComputed[featureId] = true;
48 }
49 return TreeCtrDataSet.CtrBorders.SliceView(bordersSlice).AsConstBuf();
50}
51
52void NCatboostCuda::TTreeCtrDataSetBuilder::ComputeCtrBorders(const NCatboostCuda::TTreeCtrDataSetBuilder::TVec& ctr,
53 const NCatboostOptions::TBinarizationOptions& binarizationDescription,

Callers 15

GetActiveFeaturesIndicesFunction · 0.45
CreateFloatSplitMethod · 0.45
CreateCtrSplitMethod · 0.45
with_lockFunction · 0.45
CheckDataSetFunction · 0.45
SplitMethod · 0.45
TrainModelMethod · 0.45

Calls 3

SliceViewMethod · 0.80
AsConstBufMethod · 0.80
containsMethod · 0.45

Tested by 2

CheckDataSetFunction · 0.36
SplitMethod · 0.36