diff options
Diffstat (limited to 'RhSolutions.ML.Tests')
-rw-r--r-- | RhSolutions.ML.Tests/RhSolutionsTests.cs | 12 |
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 |