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

Method SetSampledControl

catboost/private/libs/algo/calc_score_cache.cpp:1172–1194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1170}
1171
1172void TCalcScoreFold::SetSampledControl(
1173 int docCount,
1174 ESamplingUnit samplingUnit,
1175 const TVector<TQueryInfo>& queriesInfo,
1176 TRestorableFastRng64* rand
1177) {
1178 if (BernoulliSampleRate == 1.0f || IsPairwiseScoring) {
1179 Fill(Control.begin(), Control.end(), true);
1180 return;
1181 }
1182 if (samplingUnit == ESamplingUnit::Group) {
1183 for (auto& queryInfo : queriesInfo) {
1184 auto itBegin = GetDataPtr(Control, queryInfo.Begin);
1185 auto itEnd = GetDataPtr(Control, queryInfo.End);
1186 auto isTaken = rand->GenRandReal1() < BernoulliSampleRate;
1187 Fill(itBegin, itEnd, isTaken);
1188 }
1189 } else {
1190 for (int docIdx = 0; docIdx < docCount; ++docIdx) {
1191 Control[docIdx] = rand->GenRandReal1() < BernoulliSampleRate;
1192 }
1193 }
1194}
1195
1196void TCalcScoreFold::SetControlNoZeroWeighted(
1197 int docCount,

Callers

nothing calls this directly

Calls 5

GetDataPtrFunction · 0.85
GenRandReal1Method · 0.80
FillFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected