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 shou"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 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 spls.
The user should install splsda functions.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