def test_calculate_entropy_2_order(): text = 'abcdd' tree = __build_tree(text, 2) got = __calculate_entropy(tree, len(text)) expected = 0.2 assert_equal(expected, got)
def test_calculate_entropy_1_order(): text = 'abcdd' tree = __build_tree(text, 1) got = __calculate_entropy(tree, len(text)) expected = 1.9219280948873623 assert_equal(expected, got)