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

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

Open
irisk2050 opened this issue Aug 29, 2024 · 2 comments
Open

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

irisk2050 opened this issue Aug 29, 2024 · 2 comments

Comments

@irisk2050
Copy link

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
Copy link
Owner

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

@irisk2050
Copy link
Author

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.

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

No branches or pull requests

2 participants