| 384 | } |
| 385 | |
| 386 | bool TLibSvmDataLoader::DataHasGroupId(TStringBuf line) { |
| 387 | auto splitter = StringSplitter(line).Split(' '); |
| 388 | auto lineIterator = splitter.begin(); |
| 389 | auto endLineIterator = splitter.end(); |
| 390 | |
| 391 | CB_ENSURE(lineIterator != endLineIterator, "Error in libsvm data. Line 0 is empty"); |
| 392 | ++lineIterator; |
| 393 | |
| 394 | if (lineIterator == endLineIterator) { |
| 395 | return false; |
| 396 | } |
| 397 | |
| 398 | if ((*lineIterator).Token().Before(':') == "qid"sv) { |
| 399 | return true; |
| 400 | } |
| 401 | |
| 402 | return false; |
| 403 | } |
| 404 | |
| 405 | void TLibSvmDataLoader::ProcessCdData(TVector<ui32>* catFeatures, TVector<TString>* featureNames) { |
| 406 | catFeatures->clear(); |