bambinos / bambi

BAyesian Model-Building Interface (Bambi) in Python.
https://bambinos.github.io/bambi/
MIT License
1.08k stars 124 forks source link

interpret get name of LazyVariable #773

Closed GStechschulte closed 9 months ago

GStechschulte commented 9 months ago

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 commented 9 months ago

Thanks a lot!

tjburch commented 9 months ago

Thanks @GStechschulte!