Skip to main content

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 separates structure learning (finding the DAG) from parameter learning (optimizing the CPTs). Structure learning is handled by bnclassify; dplbnDE then uses DE to discriminatively optimize the parameters.

Supported structures

Naive Bayes (nb)

Class is the sole parent of every feature. Features are conditionally independent given the class. Simple and fast.

TAN — tan / tancl

Tree Augmented Naive Bayes via the Chow-Liu algorithm. Each feature has the class plus at most one other feature as parent.

Hill-Climbing (hc)

Greedy search via bnclassify::tan_hc. Accepts a k parameter for cross-validation scoring folds.

Custom edgelist

Supply any valid DAG as a matrix of (from, to) edges for domain-expert topologies.

Choosing a structure

# Naive Bayes
result <- lshade(NP=30, G=50, data=car, class.name="class", structure="nb")

# Tree Augmented Naive Bayes (Chow-Liu)
result <- lshade(NP=30, G=50, data=car, class.name="class", structure="tan")

# Hill-Climbing with k=3 folds
result <- jade(NP=30, G=50, data=car, class.name="class", structure="hc", k=3)

The DE result object

Every algorithm returns an S3 object of class DE:
FieldTypeDescription
$Bestbnc_bnBest network found — highest CLL
$BestCLLnumericCLL of the best network
$pobFinallistAll networks in the final population
$CLLPobFinalnumeric vectorCLL of each final population member
$N.evalsintegerTotal fitness evaluations
$convergencenumeric vectorBest CLL at each generation
$evaluationsinteger vectorCumulative evaluations per generation

Using results for prediction

$Best is a bnc_bn object compatible with all bnclassify functions:
predictions <- predict(result$Best, newdata)
accuracy(predictions, newdata$class)
The class variable must appear in your edge list when using a custom structure, and all node names must match column names in your data frame.

Build docs developers (and LLMs) love