when I run the test - it passes the three features in the example; but the fourth test gives the below error. Not sure where to start with debugging.
Information Gain from splitting the root on brown cap: 0.034851554559677034
Information Gain from splitting the root on tapering stalk shape: 0.12451124978365313
Information Gain from splitting the root on solitary: 0.2780719051126377
AssertionError Traceback (most recent call last)
in
9
10 # UNIT TESTS
—> 11 compute_information_gain_test(compute_information_gain)
~/work/public_tests.py in compute_information_gain_test(target)
110 node_indexes = list(range(4))
111 result = target(X, y, node_indexes, 0)
→ 112 assert np.isclose(result, 0.311278, atol=1e-6), f"Wrong information gain. Expected {0.311278} got: {result}"
113
114 result = target(X, y, node_indexes, 1)
AssertionError: Wrong information gain. Expected 0.311278 got: 0.44902249956730633