powered by
Runs k-fold cross-validation over c1, c2, and optionally gamma.
c1
c2
gamma
cv_tsvm(x, y, c1_grid, c2_grid, gamma_grid = NULL, k = 5, ...)
A cv_tsvm object with best_params and results.
cv_tsvm
best_params
results
Numeric matrix or data frame of predictors.
Two-class response.
Positive numeric vectors.
Optional positive numeric vector. If NULL, gamma is left at the tsvm() default.
NULL
tsvm()
Number of folds.
Additional arguments passed to tsvm().
set.seed(10) dat <- gen_moons(40, noise = 0.1) cv <- cv_tsvm(dat$x, dat$y, c1_grid = c(0.1, 1), c2_grid = c(0.1, 1), k = 3) cv$best_params
Run the code above in your browser using DataLab