Learn R Programming

suropt (version 0.1.1)

train_sme: Trainer for a surmodel object based on the SME algorithm

Description

Trainer for a surmodel object based on the SME algorithm

Usage

train_sme(model, niter, optimizer = "nsga2")

Arguments

model

surmodel object to be trained

niter

integer indicating number of iterations

optimizer

character, only working for nsga2 by now

Examples

Run this code
# NOT RUN {
# fn <- shaffer2
# model <- build_surmodel(fn, 10, 1) %>% train_sme(5)

# fn <- binh
# model <- build_surmodel(fn, 10, 2) %>% train_sme(5)
# suropt:::plot_predict(model)

# data <- data.frame(X.1 = runif(5), X.2 = runif(5), Y.1 = runif(5), G.1 = rnorm(5))
# x_star <- build_surmodel(data) %>% train_sme(-1)
# }

Run the code above in your browser using DataLab