silplot {classmap} | R Documentation |
Draw the silhouette plot of a classification
Description
Draw the silhouette plot to visualize classification results, based on the output of one of the vcr.*.*
functions in this package. The horizontal axis of the silhouette plot shows each case's s(i)
.
Usage
silplot(vcrout, classLabels = NULL, classCols = NULL,
showLegend = TRUE, showClassNumbers = FALSE,
showCases = FALSE, drawLineAtAverage = FALSE,
topdown = TRUE, main = NULL, summary = TRUE)
Arguments
vcrout |
output of |
classLabels |
the labels (levels) of the classes. If |
classCols |
a list of colors for the classes. There should be at least as many as there are levels. If |
showLegend |
if |
showClassNumbers |
if |
showCases |
if |
topdown |
if |
drawLineAtAverage |
if |
main |
title for the plot. If |
summary |
if |
Value
A ggplot object containing the silhouette plot.
Author(s)
Raymaekers J., Rousseeuw P.J.
References
Raymaekers J., Rousseeuw P.J.(2021). Silhouettes and quasi residual plots for neural nets and tree-based classifiers. (link to open access pdf)
See Also
vcr.da.train
, vcr.da.newdata
,
vcr.knn.train
, vcr.knn.newdata
,
vcr.svm.train
, vcr.svm.newdata
,
vcr.rpart.train
, vcr.rpart.newdata
,
vcr.forest.train
, vcr.forest.newdata
,
vcr.neural.train
, vcr.neural.newdata
Examples
vcrout <- vcr.da.train(iris[, 1:4], iris[, 5])
silplot(vcrout)
# For more examples, we refer to the vignettes:
## Not run:
vignette("Discriminant_analysis_examples")
vignette("K_nearest_neighbors_examples")
vignette("Support_vector_machine_examples")
vignette("Rpart_examples")
vignette("Forest_examples")
vignette("Neural_net_examples")
## End(Not run)