pzivich / Delicatessen

Delicatessen: the Python one-stop sandwich (variance) shop 🥪
https://deli.readthedocs.io/en/latest/index.html
MIT License
22 stars 2 forks source link

Generalized Additive Models [EE] #20

Closed pzivich closed 1 year ago

pzivich commented 1 year ago

Is your feature request related to a problem? Please describe. No, this is only an enhancement.

Describe the solution you'd like Add estimating equations for generalized additive models. This is fairly straightforward as I already have L2-penalized regression implemented. All that really needs to be added is functionalities for different basis functions (like splines). There are some options I need to think through further though (e.g., applying different basis functions to different elements, generating predicted values from the GAM, as the predictors will be internally transformed)

Describe alternatives you've considered Use outside GAM implementations, but this would be a nice thing to have. Also would put delicatessen closer so flexible ML models (a benefit in bioinformatics uptake).

Additional context None

pzivich commented 1 year ago

A by-hand example of GAMs is now available. Overall feature still to be picked up.

https://github.com/pzivich/Delicatessen/blob/main/examples/Generalized-Additive-Model.ipynb

pzivich commented 1 year ago

Note: the penalty term should only be applied to the splines (not the linear terms). That way the wiggle of the function is penalized, not the overall linear relationship