Пример #1
0
def test_get_ranks(data):
    dat = data["same_views"]
    precomp = []
    for i in dat:
        precomp.append(svd_wrapper(i))
    ajive = AJIVE(init_signal_ranks=[2, 2], joint_rank=1)
    ajive.fit(dat, precomp_init_svd=precomp)
    joint_rank, indiv_ranks = ajive.get_ranks()
    assert joint_rank == 1
    for rank1, rank2 in zip(indiv_ranks, [0, 1]):
        assert rank1 == rank2
Пример #2
0
def test_get_ranks_not_computed(data):
    with pytest.raises(ValueError):
        ajive = AJIVE(init_signal_ranks=[2, 2])
        ajive.get_ranks()