TMaddox commented on a change in pull request #1234: URL: https://github.com/apache/systemds/pull/1234#discussion_r619852790
########## File path: src/main/python/tests/algorithms/test_pca.py ########## @@ -49,10 +51,38 @@ def test_500x2(self): m1 = self.generate_matrices_for_pca(30, seed=1304) X = Matrix(self.sds, m1) # print(features) - [res, model, _, _ ] = pca(X, K=1, scale="FALSE", center="FALSE").compute() + [res, model, _, _] = pca(X, K=1, scale="FALSE", center="FALSE").compute() for (x, y) in zip(m1, res): self.assertTrue((x[0] > 0 and y > 0) or (x[0] < 0 and y < 0)) + def test_500x2b(self): + """ + This test constructs a line of values in 2d space. + That if fit correctly maps perfectly to 1d space. + The check is simply if the input value was positive + then the output value should be similar. + """ + m1 = self.generate_matrices_for_pca(30, seed=1304) + X = Matrix(self.sds, m1) + # print(features) + X._check_matrix_op() + params_dict = {'X': X, 'K': 1, 'scale': "FALSE", 'center': "FALSE"} + nodeC = OperationNode2(self.sds, 'pca', named_input_nodes=params_dict, + outputs=[("res", OutputType.MATRIX), ("model", OutputType.MATRIX), ("scale", OutputType.MATRIX), ("center", OutputType.MATRIX)]) + nodeD = OperationNode2(self.sds, 'abs', unnamed_input_nodes=[nodeC.output_nodes["model"]]) Review comment: will do, thanks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org