Last active
January 9, 2023 11:57
-
-
Save cindyangelira/eb8643175e176042c62302ed7260884b to your computer and use it in GitHub Desktop.
survival learners R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create learners---- | |
learners <- lrns( | |
paste0("surv.", c("coxtime","deephit", "deepsurv", "loghaz", "pchazard")), | |
frac = 0.3, activation = "relu", | |
dropout = 0.1, | |
early_stopping = TRUE, | |
epochs = 10, | |
batch_size = 32L | |
) | |
learners <- c(learners, lrns(c("surv.kaplan", "surv.coxph"))) | |
# Create pipeline---- | |
pipeline <- function(learner){ | |
po("scale") %>>% po("learner", learner) | |
} | |
learners <- lapply(learners, pipeline) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment