Accord.Tests.MachineLearning.SequentialMinimalOptimizationTest.ComplexityHeuristicTest C# (CSharp) Méthode

ComplexityHeuristicTest() private méthode

private ComplexityHeuristicTest ( ) : void
Résultat void
        public void ComplexityHeuristicTest()
        {
            var dataset = yinyang;

            double[][] inputs = dataset.Submatrix(null, 0, 1).ToJagged();
            int[] labels = dataset.GetColumn(2).ToInt32();

            var linear = new SupportVectorMachine(inputs[0].Length);

            Linear kernel = new Linear(0);
            var machine = new KernelSupportVectorMachine(kernel, inputs[0].Length);

            var smo1 = new SequentialMinimalOptimization(machine, inputs, labels);
            smo1.UseClassProportions = true;
            smo1.UseComplexityHeuristic = true;
            double e1 = smo1.Run();

            var smo2 = new SequentialMinimalOptimization(linear, inputs, labels);
            smo2.UseClassProportions = true;
            smo2.UseComplexityHeuristic = true;
            double e2 = smo2.Run();

            Assert.AreEqual(smo1.Complexity, smo2.Complexity);
            Assert.AreEqual(e1, e2);
        }