Skip to content
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

Fix predict for drop_intercept models #76

Merged
merged 2 commits into from
Jan 8, 2019
Merged

Fix predict for drop_intercept models #76

merged 2 commits into from
Jan 8, 2019

Conversation

AsafManela
Copy link
Contributor

For models M that specify drop_intercept(M) = true, the fit(M,Formula,df) function adds back and then drops the intercept just before creating the model frame. This same idiom also needs to be applied to predict() otherwise contrast variables are mishandled, resulting in a dimension mismatch error.
This PR:

  • fixes predict with drop_intercept model and categorical variables bug
  • add tests that used to fail but now pass

@nalimilan
Copy link
Member

Cc: @piever

@piever
Copy link
Contributor

piever commented Oct 1, 2018

LGTM! At the time I forgot to test predict for the model with no intercept, well spotted!

@AsafManela
Copy link
Contributor Author

This has been reviewed a long time ago. Why not merge it?

@kleinschmidt
Copy link
Member

On the one hand, everything is going to change once #71 is merged (which should be soon, inshallah) in a way that will make this redundant. On the other hand, it might make sense to merge this one now in order to fix an obvious bug instead of having to backport it... thoughts @nalimilan ?

@nalimilan
Copy link
Member

I'd say merge, unless it creates conflicts that are too costly for you to fix (unlikely).

@kleinschmidt
Copy link
Member

Agreed.

@kleinschmidt
Copy link
Member

Thanks for the fix, and sorry for the delay in merging!

@kleinschmidt kleinschmidt merged commit a45ad63 into JuliaStats:master Jan 8, 2019
@AsafManela
Copy link
Contributor Author

No worries. Thanks for merging. I look forward to #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants