From 9c87e6d4da7a4dd08220cd0ec436a3651bc571af Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Thu, 11 Jan 2024 17:48:01 +0300 Subject: [PATCH] Add ModelBuilder --- RhSolutions.ML.Tests/ModelBuilder.cs | 10 ++++++++++ RhSolutions.ML.Tests/TestBase.cs | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 RhSolutions.ML.Tests/ModelBuilder.cs diff --git a/RhSolutions.ML.Tests/ModelBuilder.cs b/RhSolutions.ML.Tests/ModelBuilder.cs new file mode 100644 index 0000000..2fd6115 --- /dev/null +++ b/RhSolutions.ML.Tests/ModelBuilder.cs @@ -0,0 +1,10 @@ +using RhSolutions.ML.Lib; + +namespace RhSolutions.ML.Tests; + +[SetUpFixture] +public class ModelBuilder +{ + [OneTimeSetUp] + public void Build() => RhSolutionsMLBuilder.RebuildModel(); +} \ No newline at end of file diff --git a/RhSolutions.ML.Tests/TestBase.cs b/RhSolutions.ML.Tests/TestBase.cs index 679d9d3..6295c3f 100644 --- a/RhSolutions.ML.Tests/TestBase.cs +++ b/RhSolutions.ML.Tests/TestBase.cs @@ -1,5 +1,3 @@ -using RhSolutions.ML.Lib; - namespace RhSolutions.ML.Tests; public abstract class TestBase @@ -11,7 +9,6 @@ public abstract class TestBase public TestBase() { - RhSolutionsMLBuilder.RebuildModel(); _mlContext = new MLContext(seed: 0); ITransformer loadedNodel = _mlContext.Model.Load(_dataPath, out var _); _predEngine = _mlContext.Model.CreatePredictionEngine(loadedNodel); @@ -36,4 +33,4 @@ public abstract class TestBase var prediction = _predEngine.Predict(actual); Assert.That(prediction.Type, Is.EqualTo(expected.Type)); } -} \ No newline at end of file +}