| 99 | } |
| 100 | |
| 101 | bool TryGetObjectiveMetric(const TFullModel& model, NCatboostOptions::TLossDescription* lossDescription) { |
| 102 | if (model.ModelInfo.contains("params")) { |
| 103 | const auto ¶ms = ReadTJsonValue(model.ModelInfo.at("params")); |
| 104 | if (params.Has("metrics") && params["metrics"].Has("objective_metric")) { |
| 105 | lossDescription->Load(params["metrics"]["objective_metric"]); |
| 106 | return true; |
| 107 | } |
| 108 | } |
| 109 | return TryGetLossDescription(model, lossDescription); |
| 110 | } |
| 111 | |
| 112 | bool HasNonZeroApproxForZeroWeightLeaf(const TFullModel& model) { |
| 113 | for (size_t leafIdx = 0; leafIdx < model.ModelTrees->GetModelTreeData()->GetLeafWeights().size(); ++leafIdx) { |
no test coverage detected