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

Method DataHasGroupId

catboost/libs/data/libsvm_loader.cpp:386–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 6

StringSplitterFunction · 0.85
BeforeMethod · 0.80
SplitMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
TokenMethod · 0.45

Tested by

no test coverage detected