I am creating some decision trees using the package rpart in R. I have discrete variables like age, no.of.children in my dataset. But the resulting decision tree has these variables n decimals. Which means, it is considered as continuous variables.
How to avoid this and how can i get these variables as discrete in my decision tree?
Make them into factors, the standard way to represent discrete variables in R.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With