2
$\begingroup$

I'm working on a regression problem with a continuous dependent variable (sale price of a home). Amongst my features are several categorical features, which I'm transforming to "one hot encoded" dummy variables via Pandas get_dummies function.

My question is, in order to avoid the trap of multi-colinearity, one level from each categorical variable must be excluded from the model.Pandas provides this with the drop_first argument within the get_dummies function in which I can optionally exclude the first level from being included in the one hot encoding. However, this strikes me as somewhat arbitrary. Is there a strategy to ensure that the excluded level doesn't affect the accuracy of my regression model? How does one decide which level to exclude?

$\endgroup$

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.