Home > Blockchain >  Decision tree score always return 1
Decision tree score always return 1

Time:05-15

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.

This is my dataset enter image description here

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.

  • Related