GetLowestPairwiseScoringEdges | R Documentation |
Get the lowest pairwise scoring edges represented as a blacklist matrix.
This blacklisting procedure is motivated by Koller & Friedman (2003). This
is rarely used now as we found that it blacklists edges that have significant
dependencies but are not in the top n
edges. We prefer
the GetIncrementalScoringEdges method.
GetLowestPairwiseScoringEdges(scorer, n_retain)
scorer |
A scorer object. |
n_retain |
An integer representing the number of edges to retain. |
A boolean matrix of (parent, child) pairs for blacklisting.
Koller D, Friedman N. Being Bayesian about network structure. A Bayesian approach to structure discovery in Bayesian networks. Mach Learn. 2003;50(1):95–125.
data <- bnlearn::learning.test
scorer <- CreateScorer(
scorer = BNLearnScorer,
data = data
)
blacklist <- GetLowestPairwiseScoringEdges(scorer, 3)
blacklist_scorer <- CreateScorer(
scorer = BNLearnScorer,
data = data,
blacklist = blacklist,
cache = TRUE
)
# Randomly sample a starting DAG consistent with the blacklist. Then
# convert to a partition.
dag <- UniformlySampleDAG(colnames(data)) * !blacklist
partitioned_nodes <- DAGtoPartition(dag)
results <- SampleChains(10, partitioned_nodes, PartitionMCMC(), blacklist_scorer)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.