tlverse / hal9001

🤠 📿 The Highly Adaptive Lasso
https://tlverse.org/hal9001
GNU General Public License v3.0
49 stars 15 forks source link

additive models #34

Open benkeser opened 6 years ago

benkeser commented 6 years ago

It would be very cool to add a formula interface for fitting HAL additive models.

So if X has two columns x1, x2 you could write

fit_hal(..., formula = "x1 + x2")

and it would fit a 1-degree HAL

fit_hal(..., formula = "x1*x2")

would fit the 2-degree HAL, etc...

Larsvanderlaan commented 4 years ago

I happened to stumble upon this request. I've implemented the formula interface in a clone of the hal9001 package. You can see this here: https://github.com/Larsvanderlaan/RStatisticalSoftware/blob/master/hal9001fast/R/formula_hal9001.R. I've added quite a few bells and whistles which allow for much more flexible modeling (e.g. generating basis functions based on binned values, specifying monotonicity of certain terms, interactions between groups of variables). The formula_hal function essentially converts the formula into the matching basis_list. Higher order Hal (and some screening stuff) is also implemented in this clone. Though, as a heads up, I haven't yet extensively tested these features.

nhejazi commented 4 years ago

These sound like great improvements @Larsvanderlaan. Let's try to set up a time to see how we can get these new features tested and merged into hal9001, if there's time in the next week or two? I think #67 also needed to get merged if I recall correctly