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

interpret get name of LazyVariable #773

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

GStechschulte
Copy link
Collaborator

This PR resolves #772 to parse model components that are a formulae LazyVariable instance. These instances happen when a user calls a formulae stateful transformation function. In Bambi, there are really "two" function you can call on model terms:

  1. A formulae stateful transformation, i.e. basis splines, polynomial
  2. Function call from the environment, i.e. log transformation using numpy

I have added tests to the interpret module to reflect the two different types of function calls. I only added the tests for bmb.interpert.predictions since comparisons and slopes call the same function get_model_covariates where the bug was happening. So testing predictions implicitly tests the other two functions.

@tomicapretto
Copy link
Collaborator

Thanks a lot!

@tomicapretto tomicapretto merged commit 9a1387a into bambinos:main Jan 23, 2024
4 checks passed
@tjburch
Copy link
Contributor

tjburch commented Jan 24, 2024

Thanks @GStechschulte!

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.

bambi.interpret.prediction fails for polynomial regression models
3 participants