Accord.Tests.Statistics.KernelDiscriminantAnalysisTest.ComputeTest C# (CSharp) Method

ComputeTest() private method

private ComputeTest ( ) : void
return void
        public void ComputeTest()
        {
            double[,] inputs = 
            {
                { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
                { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
            };

            int[] output = { 0, 1 };

            IKernel kernel = new Gaussian(0.1);
            var target = new KernelDiscriminantAnalysis(inputs, output, kernel);
            target.Threshold = 0;

            target.Compute();

            double[,] actual = target.Transform(inputs);

            double[,] expected = 
            {
                {  1.0, -1.0 },
                { -1.0, -1.0 },
            };

            Assert.IsTrue(Matrix.IsEqual(actual, expected));
        }