Skip to content
Prev 201544 / 398506 Next

predict: remove columns with new levels automatically

Sorry for my bad description, i don't want get a constructed algorithm without own work. i only hoped to get some advice how to do this. i don't want to predict any sort of data, i reference only to newdata which variables are the same as in the model data. But if factors in the data than i can by possibly that the newdata has a level which doesn't exist in the original data.
So i have to compare each factor in the data and in the newdata and if the newdata has a levels which is not in the original data and drop this variable and do compute the model and prediction again. 
I thought this problem is quite common and i can use an algorithm somebody has already implemented.

best regards

Andreas




-------- Original-Nachricht --------