How the value of Laplace will change the naive Bayes model

r
naive_bayes

#1

I am currently building a model using naive Bayes in R and while building a came across a parameter Laplace but I am not able to understand how the value of Laplace will effect the result of model.

train<-read.csv(“train2.csv”)
test<-read.csv(“test2.csv”)

test$Survived<-NA
combinedData <- rbind(train,test)
new_train <- combinedData[1:891,]
new_test <- combinedData[892:1309,]
require(1071)

m1<-naiveBayes(new_train[,-2],as.factor(new_train[,2]),laplace=3)
here I have considered the value of Laplace is 3 I want how it effect the model.


#2

@harry- it use to use to provide Laplace smoothing to the categorical data to the value you want and if it value is zero it disables the Laplace smoothing which is usually a default value .

Hope this helps!
Regards,
hinduja1234