diff --git a/src/SharpLearning.Benchmarks/Benchmarks.ClassificationModels.cs b/src/SharpLearning.Benchmarks/Benchmarks.ClassificationModels.cs deleted file mode 100644 index 91b8960a..00000000 --- a/src/SharpLearning.Benchmarks/Benchmarks.ClassificationModels.cs +++ /dev/null @@ -1,45 +0,0 @@ -using BenchmarkDotNet.Attributes; -using SharpLearning.Containers.Matrices; -using SharpLearning.DecisionTrees.Learners; -using SharpLearning.DecisionTrees.Models; - -namespace SharpLearning.Benchmarks; - -public static partial class Benchmarks -{ - [MemoryDiagnoser] - public class ClassificationModels - { - const int Rows = 1000; - const int Cols = 10; - const int MinTargetValue = 0; - const int MaxTargetValue = 10; - F64Matrix m_features; - double[] m_targets; - - // Define learners here. Use default parameters for benchmarks. - readonly ClassificationDecisionTreeLearner m_classificationDecisionTreeLearner = new(); - ClassificationDecisionTreeModel m_classificationDecisionTreeModel; - //readonly ClassificationAdaBoostLearner m_classificationAdaBoostLearner = new(); - //readonly ClassificationRandomForestLearner m_classificationRandomForestLearner = new(); - //readonly ClassificationExtremelyRandomizedTreesLearner m_classificationExtremelyRandomizedTreesLearner = new(); - //readonly ClassificationBinomialGradientBoostLearner m_classificationBinomialGradientBoostLearner = new(); - - [GlobalSetup] - public void GlobalSetup() - { - var seed = 42; - m_targets = DataGenerator.GenerateIntegers(Rows, cols: 1, - MinTargetValue, MaxTargetValue, seed); - var features = DataGenerator.GenerateDoubles(Rows, Cols, seed); - m_features = new F64Matrix(features, Rows, Cols); - m_classificationDecisionTreeModel = m_classificationDecisionTreeLearner.Learn(m_features, m_targets); - } - - [Benchmark] - public void ClassificationDecisionTreeModel_Predict() - { - m_classificationDecisionTreeModel.Predict(m_features); - } - } -} diff --git a/src/SharpLearning.Benchmarks/program.cs b/src/SharpLearning.Benchmarks/program.cs index 25391271..60eeefae 100644 --- a/src/SharpLearning.Benchmarks/program.cs +++ b/src/SharpLearning.Benchmarks/program.cs @@ -16,6 +16,5 @@ var config = (Debugger.IsAttached ? new DebugInProcessConfig() : DefaultConfig.Instance) .WithSummaryStyle(SummaryStyle.Default.WithMaxParameterColumnWidth(200)); -BenchmarkRunner.Run(typeof(Benchmarks.ClassificationModels), config, args); -//BenchmarkRunner.Run(typeof(Benchmarks.ClassificationLearners), config, args); -//BenchmarkRunner.Run(typeof(Benchmarks.RegressionLearners), config, args); +BenchmarkRunner.Run(typeof(Benchmarks.ClassificationLearners), config, args); +BenchmarkRunner.Run(typeof(Benchmarks.RegressionLearners), config, args);