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

Method CheckGroupInfo

catboost/libs/data/target.cpp:261–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void NCB::CheckGroupInfo(
262 TConstArrayRef<TQueryInfo> groupInfoVector,
263 const TObjectsGrouping& objectsGrouping,
264 bool mustContainPairData
265) {
266 CheckDataSize(
267 groupInfoVector.size(),
268 (size_t)objectsGrouping.GetGroupCount(),
269 "groupInfo",
270 false,
271 "group count",
272 true
273 );
274
275 bool hasPairData = false;
276
277 for (auto i : xrange(groupInfoVector.size())) {
278 const auto& groupInfo = groupInfoVector[i];
279 try {
280 CB_ENSURE_INTERNAL(
281 (TGroupBounds)groupInfo == objectsGrouping.GetGroup(i),
282 "bounds " << ((const TGroupBounds&) groupInfo)
283 << " are not equal to grouping's corresponding group bounds: "
284 << objectsGrouping.GetGroup(i)
285 );
286 CheckOneGroupInfo(groupInfo);
287 if (!groupInfo.Competitors.empty()) {
288 hasPairData = true;
289 }
290 } catch (const TCatBoostException& e) {
291 // throw, not ythrow to avoid duplication of line info
292 throw TCatBoostException() << "groupInfo[" << i << "]: " << e.what();
293 }
294 }
295 CB_ENSURE_INTERNAL(!mustContainPairData || hasPairData, "groups do not contain pair data");
296}
297
298static void CheckGroupWeights(const TWeights<float>& groupWeights, const TObjectsGrouping& objectsGrouping) {
299 if (groupWeights.IsTrivial()) {

Callers

nothing calls this directly

Calls 8

CheckDataSizeFunction · 0.85
xrangeFunction · 0.85
TCatBoostExceptionClass · 0.85
GetGroupCountMethod · 0.80
GetGroupMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected