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

Implement Accelerated Failure Time model and Cox method from xgboost #161

Open
brunocarlin opened this issue Mar 10, 2022 · 5 comments
Open
Labels
feature a feature request or enhancement

Comments

@brunocarlin
Copy link

The main idea here is to get the output from those two modes of xgboost to stack it into another more standard model like Cox or Weibull similar to the idea of this package, https://loft-br.github.io/xgboost-survival-embeddings/how_xgbse_works.html#xgbsestackedweibull-xgboost-as-risk-estimator-weibull-aft-for-survival-curve

@hfrick
Copy link
Member

hfrick commented Mar 14, 2022

We likely won't implement this immediately but are open to it and would welcome a PR!

@brunocarlin
Copy link
Author

Can you help me a little bit with this pr, I don't know if I should start by modifying the file https://github.com/tidymodels/parsnip/blob/main/R/boost_tree.R or if I can just extend it, we just need to be able to set labels and the xgboost parnsip wrapper already has everything set up

# Associate ranged labels with the data matrix.
# This example shows each kind of censored labels.
#                   uncensored  right  left  interval
y_lower_bound <- c(        2.,    3.,   0.,       4.)
y_upper_bound <- c(        2.,  +Inf,   4.,       5.)
setinfo(dtrain, 'label_lower_bound', y_lower_bound)
setinfo(dtrain, 'label_upper_bound', y_upper_bound)

to work with Surv() notation we are golden

@brunocarlin
Copy link
Author

brunocarlin commented Mar 15, 2022

Also where would the stacking live, in stacks or here? There may be two good ways to stack models using proportional_hazards with engine set to glmnet allow for easy porting we can also try to use survival_reg

@hfrick
Copy link
Member

hfrick commented Mar 15, 2022

The goal is to leave the model definition boost_tree() in parsnip untouched and only add an engine in censored. Are you already familiar with the article on creating a parnsip model from scratch on tidymodels.org? It has a section on adding an engine but the part on creating a model also provides useful context. Stacking would most likely go into stacks.

@brunocarlin
Copy link
Author

Not really, in this case, I am adding another mode to the existing engine and model right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants