This function can be used to generate Latex-markup that models the full dependency between covariates and a target variable.

bayesToLatex(conditionalFeatures, targetFeature, includeValues = FALSE)

Arguments

conditionalFeatures

data.frame of Bayesian features, the target feature depends on.

targetFeature

data.frame that holds exactly one Bayesian feature, that is supposed to be the target-feture for Bayesian inferencing.

includeValues

default FALSE boolean to indicate whether to include the features' values or not, i.e. "A" vs. "A = setosa".

Value

a string that can be used in Latex documents.

Note

Use cat() to print a string that can be copy-pasted.

Examples

feat1 <- mmb::createFeatureForBayes( name = "Petal.Length", value = mean(iris$Petal.Length)) feat2 <- mmb::createFeatureForBayes( name = "Petal.Width", value = mean(iris$Petal.Width)) featT <- mmb::createFeatureForBayes( name = "Species", iris[1,]$Species, isLabel = TRUE) cat(mmb::bayesToLatex(conditionalFeatures = rbind(feat1, feat2), targetFeature = featT, includeValues = TRUE))
#> P(\textit{Species} | \textit{Petal.Length},\textit{Petal.Width}) = \frac{P(\textit{Petal.Length} \leq 3.758 | \textit{Petal.Width} \leq 1.19933333333333,\textit{Species} = \text{setosa}) \times P(\textit{Petal.Width} \leq 1.19933333333333 | \textit{Species} = \text{setosa}) \times P(\textit{Species} = \text{setosa})}{P(\textit{Petal.Length} \leq 3.758 | \textit{Petal.Width} \leq 1.19933333333333) \times P(\textit{Petal.Width} \leq 1.19933333333333)}