| 56 | } |
| 57 | |
| 58 | int GetLabelIdxForCSV(const std::string& str, int num_features, int label_idx) { |
| 59 | if (num_features <= 0) { |
| 60 | return label_idx; |
| 61 | } |
| 62 | auto str2 = Common::Trim(str); |
| 63 | auto tokens = Common::Split(str2.c_str(), ','); |
| 64 | if (static_cast<int>(tokens.size()) == num_features) { |
| 65 | return -1; |
| 66 | } else { |
| 67 | return label_idx; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | enum DataType { |
| 72 | INVALID, |
no test coverage detected