| 259 | } |
| 260 | |
| 261 | void 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 | |
| 298 | static void CheckGroupWeights(const TWeights<float>& groupWeights, const TObjectsGrouping& objectsGrouping) { |
| 299 | if (groupWeights.IsTrivial()) { |
nothing calls this directly
no test coverage detected