aGrUM  0.14.2
aprioriNoApriori.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_A_PRIORI_NO_APRIORI_H
26 #define GUM_LEARNING_A_PRIORI_NO_APRIORI_H
27 
28 #include <vector>
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 AprioriNoApriori : public Apriori< ALLOC > {
44  public:
47 
49  using allocator_type = ALLOC< NodeId >;
50 
51 
52  // ##########################################################################
54  // ##########################################################################
56 
58 
70  const DatabaseTable< ALLOC >& database,
71  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
72  nodeId2columns =
73  Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(),
74  const allocator_type& alloc = allocator_type());
75 
78 
81  const allocator_type& alloc);
82 
85 
88  const allocator_type& alloc);
89 
91  virtual AprioriNoApriori< ALLOC >* clone() const;
92 
94  virtual AprioriNoApriori< ALLOC >* clone(const allocator_type& alloc) const;
95 
97  virtual ~AprioriNoApriori();
98 
100 
101 
102  // ##########################################################################
104  // ##########################################################################
106 
109 
112 
114 
115 
116  // ##########################################################################
118  // ##########################################################################
120 
122  virtual void setWeight(const double weight) final;
123 
125  virtual bool isOfType(const std::string& type) final;
126 
128  virtual const std::string& getType() const final;
129 
131 
138  virtual bool isInformative() const final;
139 
141 
146  virtual void
147  addAllApriori(const IdSet< ALLOC >& idset,
148  std::vector< double, ALLOC< double > >& counts) final;
149 
155  virtual void addConditioningApriori(
156  const IdSet< ALLOC >& idset,
157  std::vector< double, ALLOC< double > >& counts) final;
158 
160  };
161 
162  } /* namespace learning */
163 
164 } /* namespace gum */
165 
167 #include <agrum/learning/aprioris/aprioriNoApriori_tpl.h>
168 
169 #endif /* GUM_LEARNING_A_PRIORI_NO_APRIORI_H */
AprioriNoApriori< ALLOC > & operator=(const AprioriNoApriori< ALLOC > &from)
copy operator
virtual bool isOfType(const std::string &type) final
indicates whether an apriori is of a certain type
AprioriNoApriori(const DatabaseTable< ALLOC > &database, 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
virtual const std::string & getType() const final
returns the type of the apriori
virtual void addAllApriori(const IdSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts) final
adds the apriori to a counting vector corresponding to the idset
the base class for all a priori
STL namespace.
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set...
Definition: idSet.h:45
the base class for all a priori
Definition: apriori.h:47
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual bool isInformative() const final
indicates whether the apriori is potentially informative
double weight() const
returns the weight assigned to the apriori
virtual void setWeight(const double weight) final
sets the weight of the a priori (kind of effective sample size)
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1803
The class representing a tabular database as used by learning tasks.
virtual ~AprioriNoApriori()
destructor
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Definition: apriori.h:50
virtual AprioriNoApriori< ALLOC > * clone() const
virtual copy constructor
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Size NodeId
Type for node ids.
Definition: graphElements.h:97
the no a priori class: corresponds to 0 weight-sample
virtual void addConditioningApriori(const IdSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts) final
adds the apriori to a counting vectordefined over the right hand side of the idset ...