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

Method ComputeStats

catboost/cuda/targets/pair_logit_pairwise.cpp:12–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11namespace NCatboostCuda {
12 TAdditiveStatistic TPairLogitPairwise<NCudaLib::TStripeMapping>::ComputeStats(
13 const TPairLogitPairwise<NCudaLib::TStripeMapping>::TConstVec& point,
14 const TMap<TString, TString> params) const {
15 CB_ENSURE(params.size() == 0);
16
17 const auto& samplesGrouping = TParent::GetSamplesGrouping();
18 TVector<float> result;
19 auto tmp = TVec::Create(point.GetMapping().RepeatOnAllDevices(1));
20 FillBuffer(tmp, 0.0f);
21
22 ApproximatePairLogit(samplesGrouping.GetPairs(),
23 samplesGrouping.GetPairsWeights(),
24 samplesGrouping.GetOffsetsBias(),
25 point,
26 (const TBuffer<ui32>*)nullptr,
27 &tmp,
28 (TBuffer<float>*)nullptr,
29 (TBuffer<float>*)nullptr);
30
31 NCudaLib::TCudaBufferReader<TVec>(tmp)
32 .SetFactorSlice(TSlice(0, 1))
33 .SetReadSlice(TSlice(0, 1))
34 .ReadReduce(result);
35
36 return MakeSimpleAdditiveStatistic(result[0], GetPairsTotalWeight());
37 }
38
39 double TPairLogitPairwise<NCudaLib::TStripeMapping>::GetPairsTotalWeight() const {
40 if (PairsTotalWeight <= 0) {

Callers

nothing calls this directly

Calls 8

ApproximatePairLogitFunction · 0.85
GetMappingMethod · 0.80
ReadReduceMethod · 0.80
CreateFunction · 0.50
TSliceClass · 0.50
sizeMethod · 0.45
RepeatOnAllDevicesMethod · 0.45

Tested by

no test coverage detected