splsda( x, y, K, eta, kappa=0.5, classifier=c('lda','logistic'), scale.x=TRUE, ... )eta should be between 0 and 1. kappa is relevant only for multicategory classification.
kappa should be between 0 and 0.5. Default is 0.5. "logistic" or "lda".
Default is "lda".spls.splsda object is returned.
print, predict, coef methods use this object.y is assumed to have numerical values, 0, 1, ..., G,
where G is the number of classes subtracted by one.
The option classifier refers to the classifier used in the second step of SPLSDA
and splsda utilizes algorithms offered by MASS and nnet packages
for this purpose.
If classifier="logistic", then either logistic regression or multinomial regression is used.
Linear discriminant analysis (LDA) is used if classifier="lda".
splsda also utilizes algorithms offered by the pls package for fitting spls.
The user should install pls, MASS and nnet packages before using splsda functions.
Chun H and Keles S (2010), "Sparse partial least squares for simultaneous dimension reduction and variable selection", Journal of the Royal Statistical Society - Series B, Vol. 72, pp. 3--25.
print.splsda, predict.splsda, and coef.splsda. data(prostate)
# SPLSDA with eta=0.8 & 3 hidden components
f <- splsda( prostate$x, prostate$y, K=3, eta=0.8, scale.x=FALSE )
print(f)
# Print out coefficients
coef.f <- coef(f)
coef.f[ coef.f!=0, ]
Run the code above in your browser using DataLab