diff options
author | Serghei Cebotari <serghei@cebotari.ru> | 2024-01-12 00:24:19 +0300 |
---|---|---|
committer | Serghei Cebotari <serghei@cebotari.ru> | 2024-01-12 00:24:19 +0300 |
commit | 394b5393c046edef9a9eb2c51036660037703a3e (patch) | |
tree | c97bd484e037bae4cc82b7b0ec25e10e3a52bc88 | |
parent | fb94d14854b0663f810128d3341911f82441653c (diff) |
Add model metrics test
-rw-r--r-- | RhSolutions.ML.Tests/ModelTests.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/RhSolutions.ML.Tests/ModelTests.cs b/RhSolutions.ML.Tests/ModelTests.cs new file mode 100644 index 0000000..c31b774 --- /dev/null +++ b/RhSolutions.ML.Tests/ModelTests.cs @@ -0,0 +1,24 @@ +using RhSolutions.ML.Lib; + +namespace RhSolutions.ML.Tests; + +public class ModelTests +{ + [Test] + public void EvaluateTest() + { + var testMetrics = RhSolutionsMLBuilder.EvaluateModel(); + Console.WriteLine($"*************************************************************************************************************"); + Console.WriteLine($"* Metrics for Multi-class Classification model - Test Data "); + Console.WriteLine($"*------------------------------------------------------------------------------------------------------------"); + Console.WriteLine($"* MicroAccuracy: {testMetrics.MicroAccuracy:0.###}"); + Console.WriteLine($"* MacroAccuracy: {testMetrics.MacroAccuracy:0.###}"); + Console.WriteLine($"* LogLoss: {testMetrics.LogLoss:#.###}"); + Console.WriteLine($"* LogLossReduction: {testMetrics.LogLossReduction:#.###}"); + Console.WriteLine($"*************************************************************************************************************"); + Assert.That(testMetrics.MicroAccuracy, Is.AtLeast(0.95)); + Assert.That(testMetrics.MacroAccuracy, Is.AtLeast(0.95)); + Assert.That(testMetrics.LogLoss, Is.AtMost(0.2)); + Assert.That(testMetrics.LogLossReduction, Is.AtLeast(0.95)); + } +}
\ No newline at end of file |