naiveBayes_likelihood | R Documentation |
Internal soundgen function
naiveBayes_likelihood(
d,
nObs = nrow(d),
mod_train,
class_names,
nClasses = length(class_names),
like_names,
predictors,
nPredictors = length(predictors)
)
d |
dataframe containing the observations |
nObs |
the number of observations |
mod_train |
the output of naiveBayes_train() |
class_names |
names of outcome classes |
nClasses |
the number of outcome classes |
like_names |
the names of variables holding likelihoods |
predictors |
the names of predictor variables |
nPredictors |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.