Hi all,
I have a problem with the last function of the Lab (Get_best_split).
I got the correct result with solution I implemented but It seems that it doesnt work for the final test:
“# UNIT TESTS
get_best_split_test(get_best_split)”
I ve already fixed my code to deal with a pure target variable or when the target is fully correlated with a feature… but there is still one more error, as bellow:
AssertionError Traceback (most recent call last)
in
3
4 # UNIT TESTS
----> 5 get_best_split_test(get_best_split)
~/work/public_tests.py in get_best_split_test(target)
149 node_indexes = [2, 3, 4]
150 result = target(X, y, node_indexes)
→ 151 assert result == 0, f"Wrong result. Expected 0, got {result}"
152
153 n_samples = 100
AssertionError: Wrong result. Expected 0, got 1