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

Function CreateLogger

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

Source from the content-addressed store, hash-verified

515}
516
517static TLogger CreateLogger(
518 const TString& token,
519 const TString& resultDir,
520 const TString& metricsFile,
521 int iterationBegin,
522 int iterationEnd,
523 int iterationPeriod,
524 bool saveMetrics,
525 const TVector<const IMetric*>& metrics
526) {
527 TLogger logger(iterationBegin, iterationEnd - 1, iterationPeriod);
528 if (saveMetrics) {
529 logger.AddBackend(
530 token,
531 TIntrusivePtr<ILoggingBackend>(new TErrorFileLoggingBackend(JoinFsPaths(resultDir, metricsFile))));
532 }
533 logger.AddBackend(
534 token,
535 TIntrusivePtr<ILoggingBackend>(new TTensorBoardLoggingBackend(JoinFsPaths(resultDir, token))));
536
537 const int iterationsCount = ceil((iterationEnd - iterationBegin) / (iterationPeriod + 0.0));
538 auto metaJson = GetJsonMeta(
539 iterationsCount,
540 /*optionalExperimentName=*/ "",
541 metrics,
542 /*learnSetNames=*/ {},
543 { token },
544 /*parametersName=*/ "",
545 ELaunchMode::Eval);
546 logger.AddBackend(
547 token,
548 TIntrusivePtr<ILoggingBackend>(
549 new TJsonLoggingBackend(JoinFsPaths(resultDir, "catboost_training.json"), metaJson)));
550 return logger;
551}
552
553TMetricsPlotCalcer& TMetricsPlotCalcer::SaveResult(
554 const TString& resultDir,

Callers 1

plot.cppFile · 0.85

Calls 4

JoinFsPathsFunction · 0.85
GetJsonMetaFunction · 0.85
AddBackendMethod · 0.80
ceilFunction · 0.50

Tested by

no test coverage detected