View source: R/helpers_pycox.R
predict.pycox | R Documentation |
Predicted values from a fitted pycox ANN.
## S3 method for class 'pycox' predict( object, newdata, batch_size = 256L, num_workers = 0L, interpolate = FALSE, inter_scheme = c("const_hazard", "const_pdf"), sub = 10L, type = c("survival", "risk", "all"), distr6 = FALSE, ... )
object |
|
newdata |
|
batch_size |
|
num_workers |
|
interpolate |
|
inter_scheme |
|
sub |
|
type |
( |
distr6 |
|
... |
|
A numeric
if type = "risk"
, a distr6::Matdist()
(if distr6 = TRUE
)
and type = "survival"
; a matrix
if (distr6 = FALSE
) and type = "survival"
where
entries are survival probabilities with rows of observations and columns are time-points;
or a list combining above if type = "all"
.
if (requireNamespaces("reticulate")) { fit <- coxtime(data = simsurvdata(50)) # predict survival matrix and relative risks predict(fit, simsurvdata(10), type = "all") # return as distribution if (requireNamespaces("distr6")) { predict(fit, simsurvdata(10), distr6 = TRUE) } }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.