I tried with randomforest and tree classifier, but the problem with ordinalEncoder is that the tree might treat it as a real number and break it down into a decimal number when spitting. How do you deal with that?
Yes, this makes sense to me. Models like linear regression gives importance to features based on the weights. Hence using one hot encoding in case of unordered categories is important in case of linear regression. Please correct me if I am wrong.
Very interesting. I’d like to work with this a bit; what is the data set you used? I have an interesting data set (~2,300 rows, 13 features) that can give some bizarre accuracy results using a single classification tree but performs much, much better with a random forest. I’ll try ordinal encoding on it and let you know how it performs. Good stuff! Again, please, what is this data set?
Have you tried OrdinalEncoder with your tree-based model? Let me know how it compares to OneHotEncoder!
I tried with randomforest and tree classifier, but the problem with ordinalEncoder is that the tree might treat it as a real number and break it down into a decimal number when spitting. How do you deal with that?
Yes, this makes sense to me. Models like linear regression gives importance to features based on the weights. Hence using one hot encoding in case of unordered categories is important in case of linear regression. Please correct me if I am wrong.
Right!
@@dataschool thanks for the reply ❤️
Very interesting. I’d like to work with this a bit; what is the data set you used?
I have an interesting data set (~2,300 rows, 13 features) that can give some bizarre accuracy results using a single classification tree but performs much, much better with a random forest. I’ll try ordinal encoding on it and let you know how it performs. Good stuff! Again, please, what is this data set?
See here: nbviewer.org/github/justmarkham/scikit-learn-tips/blob/master/notebooks/43_ordinal_encoding_for_trees.ipynb
Thanks! That was very helpful.
Great to hear!
Good one thanks
You're very welcome!
interesting...
Thanks!
Who on earth even tried it to find it? 😂😂