def test_split_theta(self): test_cases = [(5, 8)] for n, w in test_cases: rdata = RandomData(0, n_features=n, window_size=w) cluster = _TICCluster(1) cluster.MRF_ = rdata.block_toeplitz() blocks = cluster.split_theta(w) assert len(blocks) == w for i, B in enumerate(blocks): assert B.shape == (n, n) A = cluster.MRF_[i * n:(i + 1) * n, :n] assert_array_equal(B, A)
def test_pass_if_block_dims_correct(self): test_cases = [ (5, 10), (10, 10), (10, 1), (1, 1), (1, 10), ] for n, w in test_cases: rdata = RandomData(n_features=n, window_size=w) result = rdata.block_toeplitz().shape assert result == (n * w, n * w)