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

Function ParseBordersFileLine

catboost/libs/helpers/borders_io.cpp:9–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8namespace NCB {
9 void ParseBordersFileLine(
10 const TString& line,
11 ui32* flatFeatureIdx,
12 float* border,
13 TMaybe<ENanMode>* nanMode
14 ) {
15 TVector<TString> tokens;
16 StringSplitter(line).Split('\t').SkipEmpty().Collect(&tokens);
17 CB_ENSURE(
18 tokens.ysize() == 2 || tokens.ysize() == 3,
19 "Each line should have two or three columns");
20 *flatFeatureIdx = FromString<ui32>(tokens[0]);
21
22 *border = FromString<float>(tokens[1]);
23
24 *nanMode = Nothing();
25 if (tokens.ysize() == 3) {
26 *nanMode = FromString<ENanMode>(tokens[2]);
27 }
28 }
29
30 void OutputFeatureBorders(
31 ui32 flatFeatureIdx,

Calls 6

StringSplitterFunction · 0.85
NothingFunction · 0.85
CollectMethod · 0.80
SkipEmptyMethod · 0.80
SplitMethod · 0.45
ysizeMethod · 0.45

Tested by

no test coverage detected