59 template <
typename GRAPH_CHANGES_
SELECTOR >
64 selector.useArcAdditions(
true);
65 selector.useArcDeletions(
false);
66 selector.useArcReversals(
false);
67 selector.useArcTriangleDeletions(
false);
68 selector.setGraph(dag);
70 unsigned int nb_changes_applied = 1;
74 nb_changes_applied = 0;
78 const auto& change = selector.bestChange();
79 delta_score = selector.deltaScore(change,
true);
82 selector.applyChange(change);
83 nb_changes_applied = 1;
87 }
while (nb_changes_applied);
90 selector.useArcAdditions(
false);
91 selector.useArcDeletions(
true);
93 selector.useArcTriangleDeletions(
false);
94 selector.setGraph(dag);
97 nb_changes_applied = 0;
101 const auto& change = selector.bestChange();
102 delta_score = selector.deltaScore(change,
true);
105 selector.applyChange(change);
106 nb_changes_applied = 1;
110 }
while (nb_changes_applied);
114 selector.finalizeGraph(dag);
120 template < GUM_Numeric GUM_SCALAR,
typename GRAPH_CHANGES_
SELECTOR,
typename PARAM_ESTIMATOR >
122 PARAM_ESTIMATOR& estimator,
A class that, given a structure and a parameter estimator returns a full Bayes net.
void updateApproximationScheme(unsigned int incr=1)
Update the scheme w.r.t the new error and increment steps.
bool continueApproximationScheme(double error)
Update the scheme w.r.t the new error.
void initApproximationScheme()
Initialise the scheme.
void stopApproximationScheme()
Stop the approximation scheme.
Exception : the element we looked for cannot be found.
static BayesNet< GUM_SCALAR > createBN(ParamEstimator &estimator, const DAG &dag)
create a BN from a DAG using a one pass generator (typically ML)
DAG learnStructure(GRAPH_CHANGES_SELECTOR &selector, DAG initial_dag=DAG())
learns the structure of a Bayes net
BayesNet< GUM_SCALAR > learnBN(GRAPH_CHANGES_SELECTOR &selector, PARAM_ESTIMATOR &estimator, DAG initial_dag=DAG())
learns the structure and the parameters of a BN
bool _allowReversalsInThinPhase_
the classes to account for structure changes in a graph
The greedy thick-thinning learning algorithm (for directed graphs).
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities