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

Function GetStatistic

python-package/compile/src/io/parser.cpp:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace LightGBM {
15
16void GetStatistic(const char* str, int* comma_cnt, int* tab_cnt, int* colon_cnt) {
17 *comma_cnt = 0;
18 *tab_cnt = 0;
19 *colon_cnt = 0;
20 for (int i = 0; str[i] != '\0'; ++i) {
21 if (str[i] == ',') {
22 ++(*comma_cnt);
23 } else if (str[i] == '\t') {
24 ++(*tab_cnt);
25 } else if (str[i] == ':') {
26 ++(*colon_cnt);
27 }
28 }
29}
30
31int GetLabelIdxForLibsvm(const std::string& str, int num_features, int label_idx) {
32 if (num_features <= 0) {

Callers 1

GetDataTypeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected