0
$\begingroup$

The same question from another user can be found here
Is it helpful to have monotonic features when using a random forest for classification? To rephrase, my question is: Let's say we have a feature, for example City, with 4 categories Missing, A, B and C. And the corresponding event rates are Missing: 10%, A: 5%, B: 20%, C: 2%. Is it better to rearrange them and encode them so that the feature is monotonic? I.e.

  • Feature Encoding 1 2 3 4
  • Corresponding category C A Missing B
  • Event Rate 2% 5% 10% 20%

I understand that random forest can deal with nonlinear patterns but here it is a matter of encoding whether the feature is or not monotonic. So the question is, if leaving the feature as it is do we introduce noise? For example it is somehow forced to split at first [Missing,A,B] all together and C separately and then have another split etc while if it is introduced with the monotonic encoding the splits will make more sense?

$\endgroup$
2
  • 1
    $\begingroup$ Non-linear patterns is for continuous variables, there is no such notion for categorical variables, each category is treated differently, so I do not see a point to this. $\endgroup$ Commented Aug 24, 2022 at 8:10
  • $\begingroup$ Maybe I'm not very clear in my question. In some continuous variable let's say age or income, where we also have a missing category though flagged as -1/ -999 etc. And let's suppose the variable is monotonic in terms of event rate with the exception of missing category which has a large event rate. Suppose ages from 18 to 80 with event rates increasing from 5% to 40% and missing (with value -1 so below the age of 18) with event rate 45%. Should we encode/change the missing values encoding to a value greater than the age of 80 to have monotonicity? Would this 'help' the random forest procedure? $\endgroup$
    – Olga P.
    Commented Aug 24, 2022 at 9:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.