Description Usage Arguments Details Value Author(s) References See Also Examples
Performs a Partial Least Squares (PLS) Discriminant Analysis by giving the option to include a random leave-k fold out cross validation
1 2 3 |
variables |
matrix or data frame with explanatory variables |
group |
vector or factor with group memberships |
autosel |
logical indicating automatic selection of
PLS components by cross-validation. Default
|
comps |
integer greater than one indicating the
number of PLS components to retain. Used only when
|
validation |
type of validation, either |
learn |
optional vector of indices for a learn-set.
Only used when |
test |
optional vector of indices for a test-set.
Only used when |
cv |
string indicating the type of crossvalidation.
Avialable options are |
k |
fold left out if using LKO (usually 7 or 10) |
retain.models |
whether to retain lower models (i.e. all lower component results) |
When validation=NULL
leave-one-out (loo)
cross-validation is performed.
When
validation="learntest"
validation is performed by
providing a learn-set and a test-set of observations.
An object of class "plsda"
, basically a list with
the following elements:
functions |
table with discriminant functions |
confusion |
confusion matrix |
scores |
discriminant scores for each observation |
loadings |
loadings |
y.loadings |
y loadings |
classification |
assigned class |
error_rate |
misclassification error rate |
components |
PLS components |
Q2 |
quality of loo cross-validation |
R2 |
R-squared coefficients |
VIP |
Variable Importance for Projection |
comp_vars |
correlations between components and variables |
comp_group |
correlations between components and groups |
Charles Determan Jr, Gaston Sanchez
Tenenhaus M. (1998) La Regression PLS. Editions Technip, Paris.
Perez-Enciso M., Tenenhaus M. (2003) Prediction of clinical outcome with microarray data: a partial least squares discriminant analysis (PLS-DA) approach. Human Genetics 112: 581-592.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# load iris dataset
data(iris)
# PLS discriminant analysis specifying number of components = 2
my_pls1 = plsDA(iris[,1:4], iris$Species, autosel=FALSE, comps=2)
my_pls1$confusion
my_pls1$error_rate
# plot circle of correlations
plot(my_pls1)
# PLS discriminant analysis with automatic selection of components
my_pls2 = plsDA(iris[,1:4], iris$Species, autosel=TRUE)
my_pls2$confusion
my_pls2$error_rate
# linear discriminant analysis with learn-test validation
learning = c(1:40, 51:90, 101:140)
testing = c(41:50, 91:100, 141:150)
my_pls3 = plsDA(iris[,1:4], iris$Species, validation="learntest",
learn=learning, test=testing)
my_pls3$confusion
my_pls3$error_rate
## End(Not run)
|
predicted
original setosa versicolor virginica
setosa 49 1 0
versicolor 0 30 20
virginica 0 7 43
[1] 0.1866667
predicted
original setosa versicolor virginica
setosa 49 1 0
versicolor 0 30 20
virginica 0 7 43
[1] 0.1866667
predicted
original setosa versicolor virginica
setosa 9 1 0
versicolor 0 8 2
virginica 0 2 8
[1] 0.1666667
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.