2024-01-12 00:24:19 +03:00
|
|
|
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($"*************************************************************************************************************");
|
2024-02-08 15:41:35 +03:00
|
|
|
Assert.That(testMetrics.MicroAccuracy, Is.AtLeast(0.90));
|
|
|
|
Assert.That(testMetrics.MacroAccuracy, Is.AtLeast(0.90));
|
2024-01-12 00:24:19 +03:00
|
|
|
Assert.That(testMetrics.LogLoss, Is.AtMost(0.2));
|
2024-01-29 12:00:04 +03:00
|
|
|
Assert.That(testMetrics.LogLossReduction, Is.AtLeast(0.80));
|
2024-01-12 00:24:19 +03:00
|
|
|
}
|
|
|
|
}
|