summaryrefslogtreecommitdiff
path: root/RhSolutions.ML.Tests
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2023-12-29 00:05:17 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2023-12-29 00:05:17 +0300
commit3be0df94c032b945af803d5056fb01df7af417f3 (patch)
tree32f163fffa86afd02df3c93fe62a041038513464 /RhSolutions.ML.Tests
parenta3cc89ce049a09aeebf068e6013a7e9b142e695f (diff)
Remove RhSolutions.Console
Diffstat (limited to 'RhSolutions.ML.Tests')
-rw-r--r--RhSolutions.ML.Tests/RhSolutionsTests.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/RhSolutions.ML.Tests/RhSolutionsTests.cs b/RhSolutions.ML.Tests/RhSolutionsTests.cs
index e1ec8f4..4e91342 100644
--- a/RhSolutions.ML.Tests/RhSolutionsTests.cs
+++ b/RhSolutions.ML.Tests/RhSolutionsTests.cs
@@ -1,3 +1,5 @@
+using RhSolutions.ML.Lib;
+
namespace RhSolutions.ML.Tests;
public abstract class RhSolutionsTests
@@ -6,13 +8,13 @@ public abstract class RhSolutionsTests
protected static string _dataPath = Path.Combine(_appPath, "..", "..", "..", "..", "Models", "model.zip");
protected MLContext _mlContext;
protected PredictionEngine<Product, TypePrediction> _predEngine;
-
- [SetUp]
- public void Setup()
+
+ public RhSolutionsTests()
{
+ RhSolutionsMLBuilder.RebuildModel();
_mlContext = new MLContext(seed: 0);
ITransformer loadedNodel = _mlContext.Model.Load(_dataPath, out var _);
- _predEngine = _mlContext.Model.CreatePredictionEngine<Product, TypePrediction>(loadedNodel);
+ _predEngine = _mlContext.Model.CreatePredictionEngine<Product, TypePrediction>(loadedNodel);
}
public void Execute(string name, string expectedGroup)
@@ -23,5 +25,5 @@ public abstract class RhSolutionsTests
};
var prediction = _predEngine.Predict(p);
Assert.That(prediction.Type, Is.EqualTo(expectedGroup));
- }
+ }
} \ No newline at end of file