public void Test_Magic_3_PCA() { Matrix X = new[,] { { 8, 1, 6 }, { 3, 5, 7 }, { 4, 9, 2 } }; Matrix Y = new[,] { { -4.8990e+000, -1.4142e+000 }, { 4.4409e-016, 2.8284e+000 }, { 4.8990e+000, -1.4142e+000 } }; var pca = new PCA(); pca.Generate(X); var Yt = pca.Reduce(2).T; for (int i = 0; i < Y.Rows; i++) for (int j = 0; j < Y.Cols; j++) Assert.Equal(Y[i, j], Yt[i, j], 3); }