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

Function GetLossDescription

catboost/libs/model/model.cpp:1374–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1372}
1373
1374static TMaybe<NCatboostOptions::TLossDescription> GetLossDescription(const TFullModel& model) {
1375 TMaybe<NCatboostOptions::TLossDescription> lossDescription;
1376 if (model.ModelInfo.contains("loss_function")) {
1377 lossDescription.ConstructInPlace();
1378 lossDescription->Load(ReadTJsonValue(model.ModelInfo.at("loss_function")));
1379 }
1380 if (model.ModelInfo.contains("params")) {
1381 const auto& params = ReadTJsonValue(model.ModelInfo.at("params"));
1382 if (params.Has("loss_function")) {
1383 lossDescription.ConstructInPlace();
1384 lossDescription->Load(params["loss_function"]);
1385 }
1386 }
1387 return lossDescription;
1388}
1389
1390TString TFullModel::GetLossFunctionName() const {
1391 const TMaybe<NCatboostOptions::TLossDescription> lossDescription = GetLossDescription(*this);

Callers 3

GetLossFunctionNameMethod · 0.85
GetModelClassLabelsMethod · 0.85
SumModelsParamsFunction · 0.85

Calls 5

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

Tested by

no test coverage detected