Learn R Programming

mixOmics (version 6.2.0)

plot.tune.splsda: Plot for model performance

Description

Function to plot performance criteria, such as classification error rate or balanced error rate on a tune.splsda result.

Usage

# S3 method for tune.splsda
plot(x, optimal = TRUE, sd = TRUE, legend.position = "topright", col, …)

Arguments

x

an tune.splsda object.

optimal

If TRUE, highlights the optimal keepX per component

sd

If 'nrepeat' was used in the call to 'tune.splsda', error bar shows the standard deviation if sd=TRUE

legend.position

position of the legend, one of "bottomright", "bottom", "bottomleft", -"left", "topleft", "top", "topright", "right" and "center".

col

character (or symbol) color to be used, possibly vector. One color per component.

Further arguments sent to xyplot function.

Details

plot.tune.splsda plots the classification error rate or the balanced error rate from x$error.rate, for each component of the model. A circle highlights the optimal number of variables oneach component.

See Also

tune.mint.splsda, tune.splsda and http://www.mixOmics.org for more details.

Examples

Run this code
# NOT RUN {
## validation for objects of class 'splsda'
# }
# NOT RUN {
data(breast.tumors)
X = breast.tumors$gene.exp
Y = as.factor(breast.tumors$sample$treatment)
out = tune.splsda(X, Y, ncomp = 3, nrepeat = 2, logratio = "none",
test.keepX = c(5, 10, 15), folds = 10, dist = "max.dist",
progressBar = TRUE)


plot(out)

# }
# NOT RUN {
## validation for objects of class 'mint.splsda'
# }
# NOT RUN {
data(stemcells)
data = stemcells$gene
type.id = stemcells$celltype
exp = stemcells$study

out = tune(method="mint.splsda", X=data,Y=type.id, ncomp=2, study=exp, test.keepX=seq(1,10,1))
out$choice.keepX.constraint

plot(out)

# }

Run the code above in your browser using DataLab