Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.NaiveBayes

Naive Bayes Plot


Description

Visualizes the marginal probabilities of predictor variables given the class.

Usage

## S3 method for class 'NaiveBayes'
plot(x, vars, n = 1000, legendplot = TRUE, lty, col,
    ylab = "Density", main = "Naive Bayes Plot", ...)

Arguments

x

an object of class NaiveBayes

vars

variables to be plotted. If missing, all predictor variables are plotted.

n

number of points used to plot the density line.

legendplot

logical, whether to print a legend

lty

line type for different classes, defaults to the first length(x$apriori) colors of the current palette in use.

col

color for different classes, defaults to rainbow(length(x$apriori)).

ylab

label for y-axis.

main

title of the plots.

...

furhter arguments passed to the underlying plot functions.

Details

For metric variables the estimated density is plotted. For categorial variables mosaicplot is called.

Author(s)

Karsten Luebke, karsten.luebke@fom.de

See Also

Examples

data(iris)
mN <- NaiveBayes(Species ~ ., data = iris)
plot(mN)

mK <- NaiveBayes(Species ~ ., data = iris, usekernel = TRUE)
plot(mK)

klaR

Classification and Visualization

v0.6-15
GPL-2 | GPL-3
Authors
Christian Roever, Nils Raabe, Karsten Luebke, Uwe Ligges, Gero Szepannek, Marc Zentgraf, David Meyer
Initial release
2020-02-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.