View source: R/ApplyBayesTheorem4Likelihoods.R
| ApplyBayesTheorem4Likelihoods | R Documentation |
Calculates the posteriors, for given likelihoods and priors using the Bayes Theorem
ApplyBayesTheorem4Likelihoods(Likelihoods,Priors,threshold=.Machine$double.eps*1000)
Likelihoods |
List of d numeric matrices, one per feature, each matrix with 1:k columns containing the distribution of class 1:k. |
Priors |
[1:k] Numeric vector with prior probability for each class. |
threshold |
(Optional: Default=0.00001). |
Posteriors |
[1:n, 1:d] Numeric matrix with posterior probability according to the bayes theorem. |
Michael Thrun
if(requireNamespace("FCPS")){
data(Hepta)
Data=Hepta$Data
Cls=Hepta$Cls
#parametric
#V=Train_naiveBayes(Data,Cls,Gaussian=TRUE)
#ClsTrain=V$ClsTrain
#table(Cls,ClsTrain)
#non-parametric
V=Train_naiveBayes(Data,Cls,Gaussian=FALSE)
ClsTrain=V$ClsTrain
table(Cls,ClsTrain)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.