New answers tagged

2

i have read online that if we have a categorical variable with q levels, the tree has to choose from ((2^q/2)-1) splits. For a dummy variable, there is only one possible split and this induces sparsity i am not sure i understand this, say i have a column called color: red, green, blue,yellow , and i implement one hot encoding so is the number of splits that ...


2

This solution would be performant only if your values has an order. Some models use as learning function the distance between points, and if you use your method, a student in Math and a student in English (0 and 2 making a 2 distance) will have more distance than a student in Math and a student in Science (0 and 1 making a 1 distance). Using this method ...


0

Simply give each category in the response a score. 5- more than 15 times a month 4 - between 10-15 times a month 3- 7-10 times a month 2 - 3-7 times a month 1- less than thrice a month And use those scores as encodings.


0

The responses to both of those questions can be treated as categorical, as although they mention numbers you can’t fully encode the information in them as a number. You could obviously number them, e.g. “I’ll call 9-11 times per month response 1”, but the number 1 doesn’t reflect the value of the response. These types of categorical “buckets” representing a ...


1

Whether to remove the dimension or not would wholly depend on the kind of data you're working with and how important is the feature for your modelling task. What you need to ask is are the labels predefined? And by that I mean is there any particular upper bound to the kind of labels you're receiving? If yes, you could simply use label encoding from sklearn. ...


Top 50 recent answers are included