cv.sgpls: Compute and plot the cross-validated error for SGPLS...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Draw heatmap of v-fold cross-validated misclassification rates and return optimal eta (thresholding parameter) and K (number of hidden components).

Usage

1
2
cv.sgpls( x, y, fold=10, K, eta, scale.x=TRUE, plot.it=TRUE,
        br=TRUE, ftype='iden', n.core=8 )

Arguments

x

Matrix of predictors.

y

Vector of class indices.

fold

Number of cross-validation folds. Default is 10-folds.

K

Number of hidden components.

eta

Thresholding parameter. eta should be between 0 and 1.

scale.x

Scale predictors by dividing each predictor variable by its sample standard deviation?

plot.it

Draw the heatmap of cross-validated misclassification rates?

br

Apply Firth's bias reduction procedure?

ftype

Type of Firth's bias reduction procedure. Alternatives are "iden" (the approximated version) or "hat" (the original version). Default is "iden".

n.core

Number of CPUs to be used when parallel computing is utilized.

Details

Parallel computing can be utilized for faster computation. Users can change the number of CPUs to be used by changing the argument n.core.

Value

Invisibly returns a list with components:

err.mat

Matrix of cross-validated misclassification rates. Rows correspond to eta and columns correspond to number of components (K).

eta.opt

Optimal eta.

K.opt

Optimal K.

Author(s)

Dongjun Chung and Sunduz Keles.

References

Chung D and Keles S (2010), "Sparse partial least squares classification for high dimensional data", Statistical Applications in Genetics and Molecular Biology, Vol. 9, Article 17.

See Also

print.sgpls, predict.sgpls, and coef.sgpls.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    data(prostate)
    set.seed(1)

    # misclassification rate plot. eta is searched between 0.1 and 0.9 and
    # number of hidden components is searched between 1 and 5
    ## Not run: 
        cv <- cv.sgpls(prostate$x, prostate$y, K = c(1:5), eta = seq(0.1,0.9,0.1),
            scale.x=FALSE, fold=5)
    
## End(Not run)
    
    

    (sgpls(prostate$x, prostate$y, eta=cv$eta.opt, K=cv$K.opt, scale.x=FALSE))

spls documentation built on May 6, 2019, 1:09 a.m.