Internal soundgen function
naiveBayes_likelihood(
d,
nObs = nrow(d),
mod_train,
class_names,
nClasses = length(class_names),
like_names,
predictors,
nPredictors = length(predictors)
)
dataframe containing the observations
the number of observations
the output of naiveBayes_train()
names of outcome classes
the number of outcome classes
the names of variables holding likelihoods
the names of predictor variables
the number of predicto variables
A Helper function called by naiveBayes
to calculate the
likelihood of each observation. Algorithm: for each predictor and class, the
likelihood is dnorm(observation, mean_per_class, sd_per_class). I tried
non-Gaussian probability distributions (Student's t to accommodate outliers),
but Gaussian actually seems to be more robust.