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

Method GetApproxFileName

catboost/private/libs/algo/plot.cpp:409–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409TString TMetricsPlotCalcer::GetApproxFileName(ui32 plotLineIndex) {
410 const ui32 plotSize = plotLineIndex + 1;
411 if (NonAdditiveMetricsData.ApproxFiles.size() < plotSize) {
412 NonAdditiveMetricsData.ApproxFiles.resize(plotSize);
413 }
414 if (NonAdditiveMetricsData.ApproxFiles[plotLineIndex].empty()) {
415 if (!NFs::Exists(TmpDir)) {
416 NFs::MakeDirectory(TmpDir);
417 DeleteTmpDirOnExitFlag = true;
418 }
419 TString name = TStringBuilder() << CreateGuidAsString() << "_approx_" << plotLineIndex << ".tmp";
420 auto path = JoinFsPaths(TmpDir, name);
421 if (NFs::Exists(path)) {
422 CATBOOST_INFO_LOG << "Path already exists " << path << ". Will overwrite file" << Endl;
423 NFs::Remove(path);
424 }
425 NonAdditiveMetricsData.ApproxFiles[plotLineIndex] = path;
426 }
427 return NonAdditiveMetricsData.ApproxFiles[plotLineIndex];
428}
429
430void TMetricsPlotCalcer::SaveApproxToFile(ui32 plotLineIndex, const TVector<TVector<double>>& approx) {
431 auto fileName = GetApproxFileName(plotLineIndex);

Callers

nothing calls this directly

Calls 7

MakeDirectoryFunction · 0.85
CreateGuidAsStringFunction · 0.85
JoinFsPathsFunction · 0.85
TStringBuilderClass · 0.50
sizeMethod · 0.45
resizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected