| 407 | } |
| 408 | |
| 409 | TString 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 | |
| 430 | void TMetricsPlotCalcer::SaveApproxToFile(ui32 plotLineIndex, const TVector<TVector<double>>& approx) { |
| 431 | auto fileName = GetApproxFileName(plotLineIndex); |
nothing calls this directly
no test coverage detected