I got 100% score on my test set when trained using decision tree and I think it's a bit strange, given that i set max_depth = 2
. And I don't understand that I did wrong. I split my set on train and test sets, but classifier still returns 1. Here is my code.
As a sanity check, I also observed that the model accuracy is less than 70% when you limit the height of the tree to only 1. So I think the code you have provided is fine.