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

Optional dimension filter #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Optional dimension filter #16

wants to merge 3 commits into from

Conversation

kels271828
Copy link
Member

Adding dimension filter so we can create location_id*age_mid intercepts only where location_id != national_id in onemod model.

I tested that the number of variables expected is correct and that it runs. Take a look to make sure my changes make sense!

@kels271828 kels271828 requested a review from zhengp0 July 18, 2024 21:43
@@ -14,8 +14,9 @@ class Dimension:

"""

def __init__(self, name: str) -> None:
def __init__(self, name: str, filter: str | None = None) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much @kels271828! This is really cool, and it is very flexible. I am a little worry that it will depend on data contains all the necessary columns in query, and before it will only require data has self.name. Spin from this, maybe we can let user instead of providing filter, we can let them provide a reference value. And we remove ref (if any) from the self.span. But this will require to set the location_id to -1 when national_id == location_id. Just an idea, let me know what you think :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we have a skipna arg? Instead of modifying location_id, we could create a new column in preprocessing specifically for this intercept.

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.

2 participants