powered by
Visualizes the marginal probabilities of predictor variables given the class.
# S3 method for NaiveBayes plot(x, vars, n = 1000, legendplot = TRUE, lty, col, ylab = "Density", main = "Naive Bayes Plot", ...)
an object of class NaiveBayes
NaiveBayes
variables to be plotted. If missing, all predictor variables are plotted.
number of points used to plot the density line.
logical, whether to print a legend
legend
line type for different classes, defaults to the first length(x$apriori) colors of the current palette in use.
length(x$apriori)
color for different classes, defaults to rainbow(length(x$apriori)).
rainbow(length(x$apriori))
label for y-axis.
title of the plots.
furhter arguments passed to the underlying plot functions.
Karsten Luebke, karsten.luebke@fom.de
For metric variables the estimated density is plotted. For categorial variables mosaicplot is called.
mosaicplot is called.
data(iris) mN <- NaiveBayes(Species ~ ., data = iris) plot(mN) mK <- NaiveBayes(Species ~ ., data = iris, usekernel = TRUE) plot(mK)
Run the code above in your browser using DataLab