plot {NBLDA} | R Documentation |
Plot Method for the nblda
and nblda_trained
Classes
Description
This function is used to generate model performance plots using ggplot2
functions.
Usage
## S3 method for class 'nblda'
plot(
x,
y,
...,
theme = c("nblda", "default"),
metric = c("accuracy", "error", "sparsity"),
return = c("plot", "aes")
)
## S3 method for class 'nblda_trained'
plot(
x,
y,
...,
theme = c("nblda", "default"),
metric = c("accuracy", "error", "sparsity"),
return = c("plot", "aes")
)
## S4 method for signature 'nblda'
plot(
x,
y,
...,
theme = c("nblda", "default"),
metric = c("accuracy", "error", "sparsity"),
return = c("plot", "aes")
)
## S4 method for signature 'nblda_trained'
plot(
x,
y,
...,
theme = c("nblda", "default"),
metric = c("accuracy", "error", "sparsity"),
return = c("plot", "aes")
)
Arguments
x |
a |
y |
same as |
... |
further arguments to be passed to plotting function |
theme |
pre-defined plot themes. It can be defined outside |
metric |
which metric should be used in the y-axis? |
return |
should a complete plot or a ggplot object from |
Value
A list of class ggplot
.
Author(s)
Dincer Goksuluk
See Also
Examples
set.seed(2128)
counts <- generateCountData(n = 20, p = 10, K = 2, param = 1, sdsignal = 0.5,
DE = 0.8, allZero.rm = FALSE, tag.samples = TRUE)
x <- t(counts$x + 1)
y <- counts$y
xte <- t(counts$xte + 1)
ctrl <- nbldaControl(folds = 2, repeats = 2)
fit <- trainNBLDA(x = x, y = y, type = "mle", tuneLength = 10,
metric = "accuracy", train.control = ctrl)
plot(fit)
# Use pre-defined theme
plot(fit, theme = "nblda")
# Externally defining plot theme
plot(fit, theme = "default") + theme_dark(base_size = 14)
# Return empty ggplot object and add layers.
plot(fit, theme = "nblda", return = "aes") +
geom_point() + geom_line(linetype = 2)
[Package NBLDA version 1.0.1 Index]