aGrUM  0.14.2
paramEstimatorML.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_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 will 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  ***************************************************************************/
25 #ifndef GUM_LEARNING_PARAM_ESTIMATOR_ML_H
26 #define GUM_LEARNING_PARAM_ESTIMATOR_ML_H
27 
28 #include <sstream>
29 
30 #include <agrum/agrum.h>
32 
33 namespace gum {
34 
35  namespace learning {
36 
42  template < template < typename > class ALLOC = std::allocator >
43  class ParamEstimatorML : public ParamEstimator< ALLOC > {
44  public:
46  using allocator_type = ALLOC< NodeId >;
47 
48  // ##########################################################################
50  // ##########################################################################
52 
54 
78  const DBRowGeneratorParser< ALLOC >& parser,
79  const Apriori< ALLOC >& external_apriori,
80  const Apriori< ALLOC >& score_internal__apriori,
81  const std::vector< std::pair< std::size_t, std::size_t >,
82  ALLOC< std::pair< std::size_t, std::size_t > > >&
83  ranges,
84  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
85  nodeId2columns =
86  Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(),
87  const allocator_type& alloc = allocator_type());
88 
90 
108  const DBRowGeneratorParser< ALLOC >& parser,
109  const Apriori< ALLOC >& external_apriori,
110  const Apriori< ALLOC >& score_internal__apriori,
111  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
112  nodeId2columns =
113  Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(),
114  const allocator_type& alloc = allocator_type());
115 
118 
121  const allocator_type& alloc);
122 
125 
128  const allocator_type& alloc);
129 
131  virtual ParamEstimatorML< ALLOC >* clone() const;
132 
134  virtual ParamEstimatorML< ALLOC >* clone(const allocator_type& alloc) const;
135 
137  virtual ~ParamEstimatorML();
138 
140 
141 
142  // ##########################################################################
144  // ##########################################################################
145 
147 
150 
153 
155 
156 
157  // ##########################################################################
159  // ##########################################################################
161 
163 
165 
172  virtual std::vector< double, ALLOC< double > > parameters(
173  const NodeId target_node,
174  const std::vector< NodeId, ALLOC< NodeId > >& conditioning_nodes);
175 
177  };
178 
179  } /* namespace learning */
180 
181 } /* namespace gum */
182 
185 
186 #endif /* GUM_LEARNING_PARAM_ESTIMATOR_ML_H */
the base class for all a priori
Definition: apriori.h:47
virtual ~ParamEstimatorML()
destructor
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
const std::vector< std::pair< std::size_t, std::size_t >, ALLOC< std::pair< std::size_t, std::size_t > > > & ranges() const
returns the current ranges
ParamEstimatorML(const DBRowGeneratorParser< ALLOC > &parser, const Apriori< ALLOC > &external_apriori, const Apriori< ALLOC > &score_internal__apriori, const std::vector< std::pair< std::size_t, std::size_t >, ALLOC< std::pair< std::size_t, std::size_t > > > &ranges, const Bijection< NodeId, std::size_t, ALLOC< std::size_t > > &nodeId2columns=Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(), const allocator_type &alloc=allocator_type())
default constructor
ParamEstimatorML< ALLOC > & operator=(const ParamEstimatorML< ALLOC > &from)
copy operator
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
virtual ParamEstimatorML< ALLOC > * clone() const
virtual copy constructor
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1803
the class for estimating parameters of CPTs using Maximum Likelihood
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
virtual std::vector< double, ALLOC< double > > parameters(const NodeId target_node, const std::vector< NodeId, ALLOC< NodeId > > &conditioning_nodes)
returns the CPT&#39;s parameters corresponding to a given nodeset
the base class for estimating parameters of CPTs
The base class for estimating parameters of CPTs.
The class for estimating parameters of CPTs using Maximum Likelihood.
the class used to read a row in the database and to transform it into a set of DBRow instances that c...
Size NodeId
Type for node ids.
Definition: graphElements.h:97