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

Function GetMetricValues

catboost/libs/train_lib/cross_validation.cpp:221–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219};
220
221static TVector<double> GetMetricValues(
222 TConstArrayRef<THolder<IMetric>> metrics,
223 TConstArrayRef<bool> skipMetric,
224 const THashMap<TString, double>& iterationMetrics
225) {
226 TVector<double> result;
227 for (auto metricIdx : xrange(metrics.size())) {
228 const auto& metricDescription = metrics[metricIdx]->GetDescription();
229 const auto isMetricAvailable = skipMetric.empty() || !skipMetric[metricIdx];
230 const auto haveMetricValue = isMetricAvailable && iterationMetrics.contains(metricDescription);
231 if (haveMetricValue) {
232 result.push_back(iterationMetrics.at(metricDescription));
233 } else {
234 result.push_back(std::numeric_limits<double>::quiet_NaN());
235 }
236 }
237 return result;
238}
239
240void Train(
241 const NCatboostOptions::TCatBoostOptions& catboostOption,

Callers 1

TrainFunction · 0.85

Calls 7

xrangeFunction · 0.85
sizeMethod · 0.45
GetDescriptionMethod · 0.45
emptyMethod · 0.45
containsMethod · 0.45
push_backMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected