2
$\begingroup$

I am performing regression task using *random forest**.In my prediction set I am having *new levels for categorical variable** which are not present in training data .Currently I am performing one hot encoding to handle this.At present I am not getting considerable results. This article is saying that it is not good to perform one hot encoding.How to handle this case?

$\endgroup$
  • $\begingroup$ Set aside an "other" column for new levels. You can't expect the model to perform well on variables it has not seen. $\endgroup$ – Emre Aug 19 '17 at 20:53
  • $\begingroup$ I am with Emre on this. Can I ask how you came up with those new levels? $\endgroup$ – tagoma Aug 20 '17 at 11:01
  • $\begingroup$ If the categorical levels can be ordered, perhaps treat the problem as regression instead? $\endgroup$ – K3---rnc Aug 20 '17 at 23:47

Your Answer

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

Browse other questions tagged or ask your own question.