aGrUM  0.17.2
a C++ library for (probabilistic) graphical models
DAG2BNLearner.h
Go to the documentation of this file.
1 
29 #ifndef GUM_LEARNING_DAG_2_BN_LEARNER_H
30 #define GUM_LEARNING_DAG_2_BN_LEARNER_H
31 
32 #include <vector>
33 
34 #include <agrum/agrum.h>
37 #include <agrum/BN/BayesNet.h>
38 #include <agrum/tools/graphs/DAG.h>
40 
41 namespace gum {
42 
43  namespace learning {
44 
51  template < template < typename > class ALLOC = std::allocator >
52  class DAG2BNLearner: public ApproximationScheme, private ALLOC< NodeId > {
53  public:
55  using allocator_type = ALLOC< NodeId >;
56 
57  // ##########################################################################
59  // ##########################################################################
61 
64 
67 
70  const allocator_type& alloc);
71 
74 
77 
79  virtual DAG2BNLearner< ALLOC >* clone() const;
80 
82  virtual DAG2BNLearner< ALLOC >* clone(const allocator_type& alloc) const;
83 
85  virtual ~DAG2BNLearner();
86 
88 
89 
90  // ##########################################################################
92  // ##########################################################################
93 
95 
98 
101 
103 
104 
105  // ##########################################################################
107  // ##########################################################################
109 
111  template < typename GUM_SCALAR = double >
113  const DAG& dag);
114 
116 
120  template < typename GUM_SCALAR = double >
122  ParamEstimator< ALLOC >& general_estimator,
123  const DAG& dag);
124 
127 
130 
132 
133 #ifndef DOXYGEN_SHOULD_SKIP_THIS
134 
135  private:
137 
139  template < typename GUM_SCALAR = double >
140  static void
141  __probaVarReordering(gum::Potential< GUM_SCALAR >& pot,
142  const gum::Potential< GUM_SCALAR >& other_pot);
143 
144 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
145  };
146 
147  } /* namespace learning */
148 
149 } /* namespace gum */
150 
153 
154 #endif /* GUM_LEARNING_DAG_2_BN_LEARNER_H */
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:60
Class representing a Bayesian Network.
Definition: BayesNet.h:78
static BayesNet< GUM_SCALAR > createBN(ParamEstimator< ALLOC > &estimator, const DAG &dag)
create a BN from a DAG using a one pass generator (typically ML)
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Approximation Scheme.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
virtual ~DAG2BNLearner()
destructor
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Definition: agrum.h:25
allocator_type getAllocator() const
returns the allocator used by the score
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Definition: DAG2BNLearner.h:55
DAG2BNLearner< ALLOC > & operator=(const DAG2BNLearner< ALLOC > &from)
copy operator
ApproximationScheme & approximationScheme()
returns the approximation policy of the learning algorithm
virtual DAG2BNLearner< ALLOC > * clone() const
virtual copy constructor
A class that, given a structure and a parameter estimator returns a full Bayes net.
Definition: DAG2BNLearner.h:52
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
The base class for estimating parameters of CPTs.
Base class for dag.
Definition: DAG.h:102
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
DAG2BNLearner(const allocator_type &alloc=allocator_type())
default constructor