aGrUM  0.14.2
DAG2BNLearner.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}@lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it wil be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef GUM_LEARNING_DAG_2_BN_LEARNER_H
27 #define GUM_LEARNING_DAG_2_BN_LEARNER_H
28 
29 #include <vector>
30 
31 #include <agrum/agrum.h>
34 #include <agrum/BN/BayesNet.h>
35 #include <agrum/graphs/DAG.h>
37 
38 namespace gum {
39 
40  namespace learning {
41 
48  template < template < typename > class ALLOC = std::allocator >
50  : public ApproximationScheme
51  , private ALLOC< NodeId > {
52  public:
54  using allocator_type = ALLOC< NodeId >;
55 
56  // ##########################################################################
58  // ##########################################################################
60 
63 
66 
69  const allocator_type& alloc);
70 
73 
76 
78  virtual DAG2BNLearner< ALLOC >* clone() const;
79 
81  virtual DAG2BNLearner< ALLOC >* clone(const allocator_type& alloc) const;
82 
84  virtual ~DAG2BNLearner();
85 
87 
88 
89  // ##########################################################################
91  // ##########################################################################
92 
94 
97 
100 
102 
103 
104  // ##########################################################################
106  // ##########################################################################
108 
110  template < typename GUM_SCALAR = double >
112  const DAG& dag);
113 
115 
119  template < typename GUM_SCALAR = double >
121  ParamEstimator< ALLOC >& general_estimator,
122  const DAG& dag);
123 
126 
129 
131 
132 #ifndef DOXYGEN_SHOULD_SKIP_THIS
133 
134  private:
136 
138  template < typename GUM_SCALAR = double >
139  static void
140  __probaVarReordering(gum::Potential< GUM_SCALAR >& pot,
141  const gum::Potential< GUM_SCALAR >& other_pot);
142 
143 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
144  };
145 
146  } /* namespace learning */
147 
148 } /* namespace gum */
149 
152 
153 #endif /* GUM_LEARNING_DAG_2_BN_LEARNER_H */
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:57
Class representing a Bayesian Network.
Definition: BayesNet.h:76
static BayesNet< GUM_SCALAR > createBN(ParamEstimator< ALLOC > &estimator, const DAG &dag)
create a BN from a DAG using a one pass generator (typically ML)
This file contains general scheme for iteratively convergent algorithms.
gum::ApproximationSchemeListener header file.
Approximation Scheme.
Class representing Bayesian networks.
virtual ~DAG2BNLearner()
destructor
gum is the global namespace for all aGrUM entities
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:54
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:49
A class that, given a structure and a parameter estimator returns a full Bayes net.
the base class for estimating parameters of CPTs
The base class for estimating parameters of CPTs.
Base class for dag.
Definition: DAG.h:99
Base classes for directed acyclic graphs.
DAG2BNLearner(const allocator_type &alloc=allocator_type())
default constructor