Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alexplatasl/dplbnde/llms.txt
Use this file to discover all available pages before exploring further.
dplbnDE supports four BN structure options, controlled by the structure argument available in all algorithm functions.
Structure options
Naive Bayes
TAN (Chow-Liu)
Hill-Climbing
The simplest structure: the class is the sole parent of every feature. No edges between features.result <- DEbest(
NP = 30, G = 50,
data = car,
class.name = names(car)[7],
structure = "nb"
)
When to use: as a fast baseline, or when you have limited data and need to avoid overfitting the structure. Tree Augmented Naive Bayes: each feature has the class plus at most one other feature as parent, selected by the Chow-Liu maximum spanning tree algorithm.result <- DEbest(
NP = 30, G = 50,
data = car,
class.name = names(car)[7],
structure = "tan" # alias for "tancl"
)
When to use: when features are correlated and you want a principled, compact structure without overfitting. Greedy structure search using bnclassify::tan_hc. Accepts additional arguments like k (cross-validation folds).result <- jade(
NP = 30, G = 50,
data = car,
class.name = names(car)[7],
structure = "hc",
k = 3 # passed to tan_hc
)
When to use: when you want a data-driven structure with more flexibility than TAN allows.
Comparing structures
Run the same DE variant with different structures and compare CLL:
library(dplbnDE)
data(car)
cn <- names(car)[7]
res_nb <- lshade(NP=20, G=30, data=car, class.name=cn, structure="nb", verbose=0)
res_tan <- lshade(NP=20, G=30, data=car, class.name=cn, structure="tan", verbose=0)
res_hc <- lshade(NP=20, G=30, data=car, class.name=cn, structure="hc", verbose=0, k=3)
cat("NB CLL:", res_nb$BestCLL, "\n")
cat("TAN CLL:", res_tan$BestCLL, "\n")
cat("HC CLL:", res_hc$BestCLL, "\n")
A higher (less negative) CLL indicates a better-fitting discriminative model. TAN and HC typically outperform NB when features have meaningful pairwise dependencies.
Any ... arguments are forwarded to bnclassify::tan_cl or bnclassify::tan_hc. For example, the k parameter for hill-climbing sets the number of cross-validation folds:
result <- jade(NP=30, G=50, data=car, class.name="class",
structure="hc", k=5)