tidymodels / censored

Parsnip wrappers for survival models
https://censored.tidymodels.org/
Other
123 stars 12 forks source link

glmnet and sparse matrices #276

Closed hfrick closed 8 months ago

hfrick commented 10 months ago

Currently, we use a parsnip encoding of allow_sparse = TRUE for glmnet but I think with us funneling everything through parsnip with a supposed formula interface for coxnet models (via our own censored::coxnet_train()) that's not actually possible, i.e. parsnip's conversion functions don't let a sparse matrix through.

So we might have to change that encoding or come up with something clever.

hfrick commented 8 months ago

Because of the conversion of x from a (sparse) matix to a data frame in parsnip::.convert_xy_to_form_fit(), we can't use sparse matrices for coxnet models so I'm gonna change the encoding to reflect that. https://github.com/tidymodels/parsnip/blob/b305a8e229ce145868593a8ae0fd9998fcf6a48e/R/convert_data.R#L230-L232

github-actions[bot] commented 8 months ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.