data(iris)
y <- iris[[5]]
M <- as.matrix(iris[-5])
### Train the Gaussian Naive Bayes with custom prior
gnb <- gaussian_naive_bayes(x = M, y = y, prior = c(0.1,0.3,0.6))
# Visualize class marginal Gaussian distributions corresponding
# to the first feature
plot(gnb, which = 1)
# Visualize class conditional Gaussian distributions corresponding
# to the first feature
plot(gnb, which = 1, prob = "conditional")
Run the code above in your browser using DataLab