plot the cross-validation curve
plot.cv.lhsc.Rd
Plot cross-validation error curves with the upper and lower standard deviations versus log lambda
values.
Usage
# S3 method for class 'cv.lhsc'
plot(x, sign.lambda, ...)
Arguments
- x
A fitted
cv.lhsc
object.- sign.lambda
Against
log(lambda)
(default) or its negative ifsign.lambda=-1
.- ...
Other graphical parameters being passed to
plot
.
Author
Oh-Ran Kwon and Hui Zou
Maintainer: Oh-Ran Kwon kwon0085@umn.edu
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))
m.cv = cv.lhsc(BUPA$X, BUPA$y, kern,
lambda=lambda, eps=1e-5, maxit=1e5)
m.cv
#> $lambda
#> [1] 1.000000e+03 2.154435e+02 4.641589e+01 1.000000e+01 2.154435e+00
#> [6] 4.641589e-01 1.000000e-01 2.154435e-02 4.641589e-03 1.000000e-03
#>
#> $cvm
#> [1] 0.4202899 0.4202899 0.4202899 0.4202899 0.4202899 0.4202899 0.4202899
#> [8] 0.4202899 0.3536232 0.3217391
#>
#> $cvsd
#> [1] 0.02787737 0.02787737 0.02787737 0.02787737 0.02787737 0.02787737
#> [7] 0.02787737 0.02787737 0.02695808 0.01613845
#>
#> $cvupper
#> [1] 0.4481672 0.4481672 0.4481672 0.4481672 0.4481672 0.4481672 0.4481672
#> [8] 0.4481672 0.3805813 0.3378776
#>
#> $cvlower
#> [1] 0.3924125 0.3924125 0.3924125 0.3924125 0.3924125 0.3924125 0.3924125
#> [8] 0.3924125 0.3266651 0.3056007
#>
#> $lambda.min
#> [1] 0.001
#>
#> $lambda.1se
#> [1] 0.001
#>
#> $cvm.min
#> [1] 0.3217391
#>
#> $cvm.1se
#> [1] 0.3217391
#>
#> attr(,"class")
#> [1] "cv.lhsc"