Beispiel #1
0
def test_cohesion_2():
    """
    Test that the reed-solomon distribution maximizes cohesion and connected
    information.
    """
    c = cohesion(reed_solomon, k=2)
    assert c == pytest.approx(12)
Beispiel #2
0
def test_cohesion_3(dist):
    """
    Test that k=n-1 is the dual total correlation.
    """
    dtc = dual_total_correlation(dist)
    c = cohesion(dist, k=3)
    assert dtc == pytest.approx(c)
Beispiel #3
0
def test_cohesion_1(dist):
    """
    Test that k=1 is the total correlation.
    """
    tc = total_correlation(dist)
    c = cohesion(dist, k=1)
    assert tc == pytest.approx(c)