predict.survivalsvm | R Documentation |
Predictions of objects of class survivalsvm
.
## S3 method for class 'survivalsvm'
predict(object, newdata, subset = NULL, ...)
object |
[ |
newdata |
[ |
subset |
[ |
... |
[ |
[survivalsvmprediction(1)
]
Object of class survivalsvmprediction
, with elements:
typeofsurvivalsvm | Type of survivalsvm object that is fitted in the model, |
typeofkernel | type of kernel used to fit the model, |
parameterofkernel | Kernel parameters used to fit the model, |
opt.meth | solver used to fit the model, |
predicted | values predicted. |
Cesaire J. K. Fouodo
survivalsvm
require(survival)
set.seed(123)
n <- nrow(veteran)
train.index <- sample(1:n, 0.7*n, replace = FALSE)
test.index <- setdiff(1:n, train.index)
survsvm.reg <- survivalsvm(Surv(veteran$diagtime, veteran$status) ~ .,
subset = train.index, data = veteran,
type = "regression", gamma.mu = 1,
opt.meth = "quadprog", kernel = "add_kernel")
pred.survsvm.reg <- predict(object = survsvm.reg, newdata = veteran, subset = test.index)
print(pred.survsvm.reg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.