| 10 | |
| 11 | namespace 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) { |
nothing calls this directly
no test coverage detected