New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intercept in Contrast Coding Schemes #370
Comments
Can intercept be added as a class parameter? |
Yes we could I think, that should be rather straight forward as well. Would you set |
Yep, I would set it to True to keep the default behavior intact |
Is this one still relevant? |
I think it is, I'm slightly in favor of setting |
user's perspective: imo encoders should do what their name says they do - encode existing columns. If there's a need to add an intercept, it has to be done consciously by the user. Especially for someone using |
Ok this seems to be a consensus, let's remove it - at least by default |
Expected Behavior
The constant (all values 1) intercept column should not be added when applying contrast coding schemes (i.e. backward difference, sum, polynomial and helmert coding)
I don't think this intercept column is needed. If you fit a supervised learning model it is probably gonna help to remove the intercept column. I think it is there because when fitting linear models with statsmodels you have to add the intercept.
However I don't like that the output of an encoder would then depend on whether the intercept column is already there or not, e.g. if I first apply encoder A on column A and then encoder B on column B the intercept column of B overwrite A's intercept column hence not adding a new column. Also if I have (for some reason) a column called intercept that is not constant it would get overwritten.
Any opinion? Am I missing something? Is the intercept necessary?
Actual Behavior
A constant column with all values 1 is added
Steps to Reproduce the Problem
Run transform on any fitted contrast coding encoder, e.g.
The text was updated successfully, but these errors were encountered: