1
$\begingroup$

I would like some insight and some typical "rules of thumb" I can use to decide when to transform continuous predictors into factors and vice versa for classification and regression trees.

Should I just experiment with different combinations and use the test error rate as a judgment criterion? If so, wouldn't this get impractical as the number of predictors increases?

$\endgroup$
  • 1
    $\begingroup$ Isn't the point of trees that cutoffs are found in a data-driven way and do not have to be pre-specified? Why do you want to cut continous variables into factors beforehand? $\endgroup$ – Achim Zeileis Jun 7 '16 at 5:06
  • $\begingroup$ I'm asking if there is an advantage to it, obviously the less preprocessing I do, the better! $\endgroup$ – Kevin Zakka Jun 7 '16 at 5:06
  • $\begingroup$ I read your question that you asked how to do the preprocessing and not why. $\endgroup$ – Achim Zeileis Jun 7 '16 at 5:20
  • $\begingroup$ I said "when" to transform meaning when is it a good idea to do it. $\endgroup$ – Kevin Zakka Jun 7 '16 at 5:21
1
$\begingroup$

The tree-classification algorithm can handle both discrete and continuous. There is no such thing "rule of thumb" when to transform and when not to transform, because it all depends on how you view your data. If you believe your data should be categorical (for example, income-groups), you should use a factor variable. However, if precision is required (eg: income per month), then you'll need to do it continuously.

Ask yourself, if you were a user, which way to view the data would make more sense? For example, when you complete tax-returns, you'd have to give your exact income. However, you'd only need to tell your friend a rough-estimate (eg: 2000-3000 per month).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.