Update not bootstraped sums on docIndexRange in a bucket
| 226 | |
| 227 | // Update not bootstraped sums on docIndexRange in a bucket |
| 228 | inline static void UpdateDeltaCount( |
| 229 | const TStatsIndexer& indexer, |
| 230 | const double* derivatives, |
| 231 | const float* learnWeights, |
| 232 | NCB::TIndexRange<int> docIndexRange, |
| 233 | TBucketStats* stats |
| 234 | ) { |
| 235 | DispatchByBitsPerValue( |
| 236 | [=] (const auto* quantizedValues) { |
| 237 | DispatchGenericLambda( |
| 238 | [=] (auto haveWeights, auto isOneNode) { |
| 239 | for (int doc : docIndexRange.Iter()) { |
| 240 | auto& leafStats = stats[indexer.GetIndex<isOneNode>(doc, quantizedValues)]; |
| 241 | leafStats.SumDelta += derivatives[doc]; |
| 242 | leafStats.Count += haveWeights ? learnWeights[doc] : 1; |
| 243 | } |
| 244 | }, |
| 245 | learnWeights != nullptr, indexer.Depth == 0); |
| 246 | }, |
| 247 | indexer.BitsPerValue, |
| 248 | indexer.QuantizedValues); |
| 249 | } |
| 250 | |
| 251 | |
| 252 | inline static void CalcStatsKernel( |
no test coverage detected