Esempio n. 1
0
    def test_outer(self):
        mat1 = MatrixRDD(self.sc.parallelize([(1, array([1, 2, 3])), (2, array([4, 5, 6]))]))
        resultA = mat1.outer()
        resultB = mat1.outer("accum")
        truth = array([[17, 22, 27], [22, 29, 36], [27, 36, 45]])
        assert array_equal(resultA, truth)
        assert array_equal(resultB, truth)

# TODO: TestCenter, TestZScore
Esempio n. 2
0
    def test_outer(self):
        mat1 = MatrixRDD(
            self.sc.parallelize([(1, array([1, 2, 3])), (2, array([4, 5,
                                                                   6]))]))
        resultA = mat1.outer()
        resultB = mat1.outer("accum")
        truth = array([[17, 22, 27], [22, 29, 36], [27, 36, 45]])
        assert array_equal(resultA, truth)
        assert array_equal(resultB, truth)


# TODO: TestCenter, TestZScore