Description Usage Arguments Value Author(s) References Examples
Compare two different Bayesian networks; compute the Structural Hamming Distance (SHD) between them or the Hamming distance between their skeletons.
1 2 3 4 5 6 |
target, learned |
an object of class |
current, true |
another object of class |
... |
extra arguments from the generic method (currently ignored). |
debug |
a boolean value. If |
arcs |
a boolean value. See below. |
compare
returns a list containing the number of true positives
(tp
, the number of arcs in current
also present in
target
), of false positives (fp
, the number of arcs in
current
not present in target
) and of false negatives
(tn
, the number of arcs not in current
but present in
target
) if arcs
is FALSE
; or the corresponding
arc sets if arcs
is TRUE
.
all.equal
returns either TRUE
or a character string
describing the differences between target
and current
.
shd
and hamming
return a non-negative integer number.
Marco Scutari
Tsamardinos I, Brown LE, Aliferis CF (2006). "The Max-Min Hill-Climbing Bayesian Network Structure Learning Algorithm". Machine Learning, 65(1), 31-78.
1 2 3 4 5 6 7 | data(learning.test)
e1 = model2network("[A][B][C|A:B][D|B][E|C][F|A:E]")
e2 = model2network("[A][B][C|A:B][D|B][E|C:F][F|A]")
shd(e2, e1, debug = TRUE)
unlist(compare(e1,e2))
compare(target = e1, current = e2, arcs = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.