pbreheny / grpreg

Regularization paths for regression models with grouped covariates
http://pbreheny.github.io/grpreg/
34 stars 14 forks source link

'weights' argument in cv.grpsurv() does not work #61

Open irisk2050 opened 3 weeks ago

irisk2050 commented 3 weeks ago

I am trying to test different weights on my cox LASSO model to see if it will improve the model's performance.

However, there was no difference in the C-index scores when the model was weighted vs any of the weights I tested (1, 2.5, 5, 7.5, 10). The 'weights' argument is not being applied to the model.

pbreheny commented 3 weeks ago

I'm confused as to what you want -- there is no weights argument in grpsurv().

irisk2050 commented 3 weeks ago

I saw a stackoverflow post that used 'weights' inside cv.grpsurv().

I've been using it in my model below:

` weights = ifelse(train_surv_ls == 1, 10, 1)

cox_ls = cv.grpsurv( X = x_train, y = train_surv_ls, group = group, lambda = lambda_values, penalty = 'grLasso', nfold = 10, weights = weights ) `

The code is running successfully in Databricks. However, it makes sense that if there is no weights argument why the model is not accounting for the weights.