Accord.Tests.MachineLearning.SequentialMinimalOptimizationTest.linear_without_threshold_doesnt_solve_xor C# (CSharp) Method

linear_without_threshold_doesnt_solve_xor() private method

private linear_without_threshold_doesnt_solve_xor ( ) : void
return void
        public void linear_without_threshold_doesnt_solve_xor()
        {
            double[][] inputs =
            {
                new double[] { -1, -1 },
                new double[] { -1,  1 },
                new double[] {  1, -1 },
                new double[] {  1,  1 }
            };

            int[] xor =
            {
                -1,
                 1,
                 1,
                -1
            };

            // Create the sequential minimal optimization teacher
            var learn = new SequentialMinimalOptimization()
            {
                Complexity = 1e-5
            };

            // Run the learning algorithm
            SupportVectorMachine machine = learn.Learn(inputs, xor);

            bool[] output = machine.Decide(inputs);

            for (int i = 0; i < output.Length; i++)
                Assert.AreEqual(false, output[i]);
        }