plot | R Documentation |
nblda
and nblda_trained
ClassesThis function is used to generate model performance plots using ggplot2
functions.
## 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") )
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 |
A list of class ggplot
.
Dincer Goksuluk
ggplot
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.