LearningHC {MoTBFs} | R Documentation |
Get a directed acyclic graph using the method hill climbing. It is a mathematical optimization technique which belongs to the family of local search. It is an iterative algorithm which deals with discrete and continuous variables.
LearningHC(dataset, numIntervals = NULL)
dataset |
A dataset with discrete and continuous variables. Discrete variables
must be of class |
numIntervals |
A |
The output is a "bn"
object containing the learned graph.
## Data
data(ecoli)
ecoli <- ecoli[,-1] ## Sequence Name
## DAG1
dag1 <- LearningHC(ecoli)
dag1
plot(dag1)
## DAG2
dag2 <- LearningHC(ecoli, numIntervals = 10)
dag2
plot(dag2)