Week 4 Calculate Information Gain Exercise 3 - Getting Assertion Error

Get the following assertion error for exercise 3

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)
103
104 result = target(X, y, node_indexes, 0)
→ 105 assert np.isclose(result, 0.019973, atol=1e-6), f"Wrong information gain. Expected {0.019973} got: {result}"
106
107 result = target(X, y, node_indexes, 1)

AssertionError: Wrong information gain. Expected 0.019973 got: 0.7505595942815911

The grading function throws assertion errors if it finds the resulted computed by the submitted code not adequate.

You will have to fix your code, which generates

0.7505595942815911

instead of

0.019973

Hi @tom037 ,

You can check your code against the pseudo code by opening up the ‘Hints’, making sure the correct parameters are passed to the calling function.