[catboost-eval-metrics] Fix bug with pool incompatibility in case of pool with cat features and GroupIds
@@ -96,7 +96,7 @@ static void ResizePool(int size, const TPool& basePool, TPool* pool) {
TPool TMetricsPlotCalcer::ProcessBoundaryGroups(const TPool& rawPool) {
TPool resultPool;
- resultPool.Docs.Swap(LastGroupPool.Docs);
+ resultPool.Swap(LastGroupPool);
const int offset = resultPool.Docs.GetDocCount();
const int rawPoolSize = rawPool.Docs.GetDocCount();
@@ -119,6 +119,11 @@ TPool TMetricsPlotCalcer::ProcessBoundaryGroups(const TPool& rawPool) {
for (int docId = 0; docId < lastQuerySize; ++docId) {
LastGroupPool.Docs.AssignDoc(docId, resultPool.Docs, newResultPoolSize + docId);
}
+ LastGroupPool.CatFeatures = rawPool.CatFeatures;
+
+ if (resultPool.CatFeatures.size() != LastGroupPool.CatFeatures.size()) {
+ resultPool.CatFeatures = LastGroupPool.CatFeatures;
+ }
ResizePool(newResultPoolSize, resultPool, &resultPool);
CB_ENSURE(resultPool.Docs.GetDocCount() != 0, "The size of the queries should be less than block-size parameter.");
