binderh / CoxBoost

R package CoxBoost
9 stars 6 forks source link

Getting relative variable importance from CoxBoost #3

Open abuhelwa opened 3 years ago

abuhelwa commented 3 years ago

I am fitting time-to-event survival data using surv.CoxBoost in the mlr package. My question: is there any way to get relative importance for the variables in the fitted model? I have seen this post detailing variable importance for cvglment but haven't seen any on CoxBoost.

Any idea?

below is an example of a model using CoxBoost.

library(randomForestSRC) library(mlr) library(survival) library(CoxBoost) data(pbc, package="randomForestSRC") data <- na.omit(pbc) set.seed(9512) train <- sample(1:nrow(data), round(nrow(data)*0.7)) data.train <- data[train, ] data.test <- data[-train, ] task = makeSurvTask( data=data.train, target=c('days', 'status')) learner= makeLearner("surv.CoxBoost") trained.learner=train(learner,task) CoxBoostfit <- trained.learner$learner.model CoxBoostfit$coefficients

abuhelwa commented 3 years ago

I mean the relative influence of each variable in predicting the outcome. RandomForestSRC has a way of ranking variables based on their influence in predicting outcome but didn't find away of doing that in CoxBoost. I am not sure if the magnitude of the coefficient is an indication her, as it may not be standardized across all variables? is it? Also, a coefficient is estimated in each boosting step. if you run 100 boosting steps then that is a 100 coefficient for each variable (assuming a variable is going to be selected in each step, which may not be the case). I was just wondering whether there is a way to get variable importance for CoxBoost models? see this example on randomForest variable imprtance: https://towardsdatascience.com/explaining-feature-importance-by-example-of-a-random-forest-d9166011959e

Thanks, Ahmad

On Saturday, January 30, 2021, 08:04:46 AM GMT+10:30, ledohod <notifications@github.com> wrote:  

What do you mean by relative importance? Do you mean decrease in prediction accuracy if a variable is removed from the model? Or its coefficient set to 0? The magnitude of coefficients should tell you something about the effects of each variable.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

flippercy commented 3 years ago

Is the package coxboost still active? The codes above do not work anymore.

binderh commented 3 years ago

What problems/error message do you specifically encounter? Currently there is no further development of the package, but the existing functionality should still work.

emucaki commented 2 years ago

What problems/error message do you specifically encounter? Currently there is no further development of the package, but the existing functionality should still work.

I believe his issue was that CoxBoost no longer appears on the list of Integrated Learners for 'mlr', so 'makeLearner("surv.CoxBoost")' fails now.

The issue can possibly corrected by installing an older version of 'mlr' (I haven't looked to see which version it would be), or implementing 'mlr3'.