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

ContrastsMatrix will silently accept non-unique levels #230

Closed
kleinschmidt opened this issue Jul 30, 2021 · 0 comments · Fixed by #231
Closed

ContrastsMatrix will silently accept non-unique levels #230

kleinschmidt opened this issue Jul 30, 2021 · 0 comments · Fixed by #231

Comments

@kleinschmidt
Copy link
Member

This came up on discourse: https://discourse.julialang.org/t/generating-dummy-variables-from-a-vector-of-strings/65507

We should enforce that the levels passed to ContrastsMatrix are all unique, because otherwise you're going to silently get non-sensical results (not least because the inverse-index mapping unique levels to numeric indices will be wrong).

I don't expect this to be a common situation but it prevents users from making mistakes while mucking around in the internals if they so desire.

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 a pull request may close this issue.

1 participant