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

Allow Term instances to control the naming of output columns in model matrices #46

Open
matthewwardrop opened this issue Oct 17, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@matthewwardrop
Copy link
Owner

This allows Term subclasses to label model matrix columns differently based on context; e.g. if a column is a random effect column, then it might be labelled as: a|g rather than a:g.

@matthewwardrop matthewwardrop added the enhancement New feature or request label Oct 17, 2021
@matthewwardrop matthewwardrop self-assigned this Oct 17, 2021
@matthewwardrop matthewwardrop added this to the 0.3.x milestone Oct 17, 2021
@matthewwardrop matthewwardrop modified the milestones: 0.3.0, 0.3.x Mar 14, 2022
@matthewwardrop matthewwardrop modified the milestones: 0.3.x, 0.4.x Jun 20, 2022
@hguturu
Copy link

hguturu commented Sep 29, 2023

I want to request a similar feature for categorical variables.

Currently they get formatted as C({parameter})[T.{value}].
E.g.,

BinGrp = [0, 0, 0, 1, 1, 1]
becomes
   C(BinGrp)[T.0]  C(BinGrp)[T.1]
0               1               0
1               1               0
2               1               0
3               0               1
4               0               1
5               0               1

It would be nice if we could pass in a format string to get simplier names. E.g. BinGrp0, BinGrp1 if we pass in a format string like "{parameter}{value}"

@matthewwardrop
Copy link
Owner Author

Hi @hguturu ! Thanks for reaching out! Let's move that to a separate issue, since this is requesting custom formatting via the formula expression itself, as compared to via the API as here. I'll let you do that and then continue the discussion there!

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

No branches or pull requests

2 participants