# How to preprocess different kinds of data (continuous, discrete, categorical) before Decision Tree learning

I want to use some Decision Tree learning, such as the Random Forest classifier.

I have data of different types: continuous, discrete and categorical. How do I have to preprocess data in order to have consistent results?

• If a categorical value has $n$ categories, you encode the value using $n$ dimensions, one corresponding to each category.
• For each data point, if it is in category $k$, the corresponding $k$th dimension is set to 1, while the rest are set to 0.