# Provide a sequence of candidate values to the argument lambda.
# ktd_cv() will perform cross-validation to determine which is the best.
( cv1d <- ktd_cv(x = dat$x, y = dat$y,
kern = rbfdot(sigma = 1e-8),
lambda = 10^(-8:-1),
nfolds = 5) )
Run the code above in your browser using DataLab