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

Function ParseEvalResult

catboost/app/mode_roc.cpp:45–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43};
44
45static void ParseEvalResult(const TString& evalResultPath, TVector<double>* approxes, TVector<float>* labels) {
46 approxes->clear();
47 labels->clear();
48 THolder<ILineDataReader> reader = GetLineDataReader(TPathWithScheme(evalResultPath));
49
50 TString header;
51 reader->ReadLine(&header);
52 TVector<TString> headerTokens = StringSplitter(header).Split('\t');
53 THashMap<TString, ui32> columnHeaders;
54 for (ui32 i = 0; i < headerTokens.size(); ++i) {
55 columnHeaders[headerTokens[i]] = i;
56 }
57 CB_ENSURE(columnHeaders.contains("Label") && columnHeaders.contains("RawFormulaVal"), "Incorrect EvalResult format.");
58 const ui32 approxColumnIndex = columnHeaders.at("RawFormulaVal");
59 const ui32 labelColumnIndex = columnHeaders.at("Label");
60
61 TString line;
62 while (reader->ReadLine(&line)) {
63 TVector<TString> tokens = StringSplitter(line).Split('\t');
64 if (tokens.empty()) {
65 continue;
66 }
67 CB_ENSURE(tokens.size() > Max(approxColumnIndex, labelColumnIndex));
68 approxes->push_back(FromString<double>(tokens[approxColumnIndex]));
69 labels->push_back(FromString<float>(tokens[labelColumnIndex]));
70 }
71}
72
73int mode_roc(int argc, const char* argv[]) {
74 TRocParams params;

Callers 1

mode_rocFunction · 0.85

Calls 12

GetLineDataReaderFunction · 0.85
StringSplitterFunction · 0.85
TPathWithSchemeClass · 0.50
MaxFunction · 0.50
clearMethod · 0.45
ReadLineMethod · 0.45
SplitMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45
atMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected