| 24 | } |
| 25 | |
| 26 | TString ClassLabelToString(const NJson::TJsonValue& classLabel) { |
| 27 | static TString trueStr("true"); |
| 28 | static TString falseStr("false"); |
| 29 | |
| 30 | switch (classLabel.GetType()) { |
| 31 | case NJson::JSON_BOOLEAN: |
| 32 | return classLabel.GetBoolean() ? trueStr : falseStr; |
| 33 | case NJson::JSON_INTEGER: |
| 34 | return ToString(classLabel.GetInteger()); |
| 35 | case NJson::JSON_DOUBLE: |
| 36 | return ToString(classLabel.GetDouble()); |
| 37 | case NJson::JSON_STRING: |
| 38 | return classLabel.GetString(); |
| 39 | default: |
| 40 | CB_ENSURE_INTERNAL(false, "bad class label type: " << classLabel.GetType()); |
| 41 | } |
| 42 | Y_UNREACHABLE(); |
| 43 | } |
| 44 | |
| 45 | TVector<TString> ClassLabelsToStrings(TConstArrayRef<NJson::TJsonValue> classLabels) { |
| 46 | TVector<TString> result; |
no test coverage detected