def test_full_align_exclude(self): m = np.array([[1, 0, .2], [0, 1, 0], [0, 0, 1]]) y = self.x * m x0 = np.hstack((np.eye(3).flatten(), np.zeros(3))) full = FullAlignData(self.x, size=200000, exclude=[0]) a, b, f, s, _ = full.align(y, x0=x0) npt.assert_array_almost_equal(a[0], np.array([1, 0, 0]), decimal=1) npt.assert_array_almost_equal(a[:, 0], np.array([1, 0, 0]), decimal=1)
def setUp(self): self.mu1 = np.array([0, 0, 0]) self.sig = 2 * np.eye(3) self.mu2 = np.array([5, 5, 5]) self.clust1 = DPCluster(.5, self.mu1, self.sig) self.clust2 = DPCluster(.5, self.mu2, self.sig) self.clusters = [self.clust1, self.clust2] self.x = DPMixture(self.clusters, niter=1, identified=True) self.diag = DiagonalAlignData(self.x, size=100000) self.comp = CompAlignData(self.x, size=100000) self.full = FullAlignData(self.x, size=200000)