MCPcopy Create free account
hub / github.com/catboost/catboost / TryGetObjectiveMetric

Function TryGetObjectiveMetric

catboost/libs/fstr/util.cpp:101–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool TryGetObjectiveMetric(const TFullModel& model, NCatboostOptions::TLossDescription* lossDescription) {
102 if (model.ModelInfo.contains("params")) {
103 const auto &params = 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
112bool HasNonZeroApproxForZeroWeightLeaf(const TFullModel& model) {
113 for (size_t leafIdx = 0; leafIdx < model.ModelTrees->GetModelTreeData()->GetLeafWeights().size(); ++leafIdx) {

Calls 6

ReadTJsonValueFunction · 0.85
TryGetLossDescriptionFunction · 0.85
containsMethod · 0.45
atMethod · 0.45
HasMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected