Skip to content

Commit

Permalink
Print failed iterations in CLI (dotnet#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinormont authored and Dmitry-A committed Aug 22, 2019
1 parent 0703e5c commit 9542a66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mlnet/Utilities/ConsolePrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ internal class ConsolePrinter

internal static void PrintBinaryClassificationMetrics(int iteration, string trainerName, BinaryClassificationMetrics metrics)
{
logger.Log(LogLevel.Info, $"{iteration,-4} {trainerName,-35} {metrics.Accuracy,9:F4} {metrics.Auc,8:F4} {metrics.Auprc,8:F4} {metrics.F1Score,9:F4}");
logger.Log(LogLevel.Info, $"{iteration,-4} {trainerName,-35} {metrics?.Accuracy ?? double.NaN,9:F4} {metrics?.Auc ?? double.NaN,8:F4} {metrics?.Auprc ?? double.NaN,8:F4} {metrics?.F1Score ?? double.NaN,9:F4}");
}

internal static void PrintMulticlassClassificationMetrics(int iteration, string trainerName, MultiClassClassifierMetrics metrics)
{
logger.Log(LogLevel.Info, $"{iteration,-4} {trainerName,-35} {metrics.AccuracyMicro,14:F4} {metrics.AccuracyMacro,14:F4}");
logger.Log(LogLevel.Info, $"{iteration,-4} {trainerName,-35} {metrics?.AccuracyMicro ?? double.NaN,14:F4} {metrics?.AccuracyMacro ?? double.NaN,14:F4}");
}

internal static void PrintRegressionMetrics(int iteration, string trainerName, RegressionMetrics metrics)
{
logger.Log(LogLevel.Info, $"{iteration,-4} {trainerName,-35} {metrics.RSquared,9:F4} {metrics.LossFn,12:F2} {metrics.L1,15:F2} {metrics.L2,15:F2} {metrics.Rms,12:F2}");
logger.Log(LogLevel.Info, $"{iteration,-4} {trainerName,-35} {metrics?.RSquared ?? double.NaN,9:F4} {metrics?.LossFn ?? double.NaN,12:F2} {metrics?.L1 ?? double.NaN,15:F2} {metrics?.L2 ?? double.NaN,15:F2} {metrics?.Rms ?? double.NaN,12:F2}");
}

internal static void PrintBinaryClassificationMetricsHeader()
Expand Down

0 comments on commit 9542a66

Please sign in to comment.