MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / GetLabelIdxForTSV

Function GetLabelIdxForTSV

src/io/parser.cpp:45–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45int GetLabelIdxForTSV(const std::string& str, int num_features, int label_idx) {
46 if (num_features <= 0) {
47 return label_idx;
48 }
49 auto str2 = Common::Trim(str);
50 auto tokens = Common::Split(str2.c_str(), '\t');
51 if (static_cast<int>(tokens.size()) == num_features) {
52 return -1;
53 } else {
54 return label_idx;
55 }
56}
57
58int GetLabelIdxForCSV(const std::string& str, int num_features, int label_idx) {
59 if (num_features <= 0) {

Callers 1

CreateParserMethod · 0.70

Calls 3

TrimFunction · 0.50
SplitFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected