Hi guys, I have a set of train and test data and I have to build a regression model using them. All the predictors are binary variables. Some of the predictors are constant (have a single value) in the train dataset but not in the test dataset. How do I train a model a model in such situation without dropping any predictor ?
How to deal with constant variables?
NSS
#2
I don’t think so there is option other than removing the constant column in the train and the test dataset.
NSS
#4
Adding noise wouldn’t but if your column is not exactly a zero variance column but a near zero, then you might want to look at these two papers that describe the methods to deal with them.

Zorn, C. (2005). A solution to separation in binary response models. Political Analysis, 13(2), 157170

Gelman, A., Jakulin, A., Pittau, M.G. and Su, Y.S. (2008). A weakly informative default prior distribution for logistic and other regression models. The Annals of Applied Statistics, 13601383