I was looking at an example from Predictive Modeling Applications in Actuarial Science

And, in one of the examples (below) -- he moves cars with 6, 7, 8 and 9 seats into the categorical variable 6+ -- why does he do that?

# Roll high values of seats (categorical variable) into a lower value
idx <- dta$seats %in% c("6", "7", "8", "9")
dta$seats[idx] <- "6+"

This is a part of the feature engineering stage in modeling.
Two key concepts in features engineering are:
1) Features should represent reality(or our assumption about reality).
2) Features different values should have good distribution(where good might mean different things).

Bucketing over 6 seats cars into one value lets one keep its reality representation while improving its feature values distribution.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.