tunedwd {kerndwd} | R Documentation |
fast tune procedure for DWD
Description
A fast implementaiton of cross-validation for kerndwd
to find the optimal values of the tuning parameter lambda
.
Usage
tunedwd(x, y, kern, lambda, qvals=1, eps=1e-5, maxit=1e+5, nfolds=5, foldid=NULL)
Arguments
x |
A matrix of predictors, i.e., the matrix |
y |
A vector of binary class labels, i.e., the |
kern |
A kernel function. |
lambda |
A user specified |
qvals |
A vector containing the index of the generalized DWD. Default value is 1. |
eps |
The algorithm stops when (i.e. |
maxit |
The maximum of iterations allowed. Default is 1e5. |
nfolds |
The number of folds. Default value is 5. The allowable range is from 3 to the sample size. |
foldid |
An optional vector with values between 1 and |
Details
This function returns the best tuning parameters
q
and lambda
by cross-validation. An efficient tune method is employed to accelerate the algorithm.
Value
A tunedwd.kerndwd
object including the cross-validation results is return.
lam.tune |
The optimal |
q.tune |
The optimal |
Author(s)
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang boxiang-wang@uiowa.edu
References
Wang, B. and Zou, H. (2018)
“Another Look at Distance Weighted Discrimination,"
Journal of Royal Statistical Society, Series B, 80(1), 177–198.
https://rss.onlinelibrary.wiley.com/doi/10.1111/rssb.12244
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
See Also
Examples
set.seed(1)
data(BUPA)
BUPA$X = scale(BUPA$X, center=TRUE, scale=TRUE)
lambda = 10^(seq(-3, 3, length.out=10))
kern = rbfdot(sigma=sigest(BUPA$X))
ret = tunedwd(BUPA$X, BUPA$y, kern, qvals=c(1,2,10), lambda=lambda, eps=1e-5, maxit=1e5)
ret