##
Information Gain from splitting the root on brown cap: 0.13091388234321688

Information Gain from splitting the root on tapering stalk shape: 0.08544279530415388

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)

94

95 result = target(X, y, node_indexes, 0)

—> 96 assert np.isclose(result, 0.019973, atol=1e-6), f"Wrong information gain. Expected {0.019973} got: {result}"

97

98 result = target(X, y, node_indexes, 1)

AssertionError: Wrong information gain. Expected 0.019973 got: 0.16485198310317206

Please help me to solve this problem.

I try a lot to calculate information gain but always be false

I know the rules but not work