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

Training for Survival Does Not Work Due To y = NULL #130

Open
drag05 opened this issue Nov 27, 2024 · 0 comments
Open

Training for Survival Does Not Work Due To y = NULL #130

drag05 opened this issue Nov 27, 2024 · 0 comments

Comments

@drag05
Copy link

drag05 commented Nov 27, 2024

Seems that check_data() is y-aware and y = NULL does not work for survival training:

> train(fertility, time = 'age', status = 'diagnosis')

✔ Type guessed as: survival 
✔ Parallel processing is turned on. Registered 15 cores. 
✔ Type provided as: survival 

Error in if (!y %in% colnames(data)) { : argument is of length zero

> traceback()

2: check_data(data, y, time, status, type, verbose, check_correlation = check_correlation) at .active-rstudio-document#84
1: train(fertility, time = "age", status = "diagnosis")

Also, condition if (!y %in% colnames(data)) should be improved to cover y = NULL as, for example,

if (isTRUE((!is.null(y) && all(!colnames(data) %in% y)))) ... elseif(is.null(y)) ...
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

1 participant