In the last function of week 4 Practice Lab, I tried a function that I thought would yield a similar result to what’s provided on the “Hint” section. But I’m getting an error that I don’t quite understand. I copied and pasted the my function and error below. Could anyone help with why this is wrong. Thanks in advance
Hi @Gard,
I can only give you a hint. Should the best_feature be updated to a different value if all feature’s gain is 0? Try to think about the answer, or read the exercise’s description again and come up with an answer, then see how your code works as your answer says.
Raymond
PS I removed your assignment code from your post because sharing it is not in compliance with the coursera honor code.
Ah great! Understood! Thank you!