View source: R/structuralLearning.R
| LearningHC | R Documentation |
Learn the structure of a hybrid Bayesian network using the hill climbing local search method.
LearningHC(dataset, numIntervals = NULL)
dataset |
A dataset with discrete and continuous variables. If the discrete
variables are not of class |
numIntervals |
A |
LearningHC() automatically converts non-numeric variables into factors
before calling function hc() from the bnlearn package. LearningHC() can also
be used to discretize the dataset, using the equal width method, before calling hc().
The output is a "bn" object containing the learned graph.
hc
## Data
data(ecoli)
ecoli <- ecoli[,-1] ## Sequence Name
## DAG1
dag1 <- LearningHC(ecoli)
dag1
plot(dag1)
## DAG2
dag2 <- LearningHC(ecoli, numIntervals = 10)
dag2
plot(dag2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.