aGrUM  0.16.0
aprioriNoApriori.h
Go to the documentation of this file.
1 
28 #ifndef GUM_LEARNING_A_PRIORI_NO_APRIORI_H
29 #define GUM_LEARNING_A_PRIORI_NO_APRIORI_H
30 
31 #include <vector>
32 
33 #include <agrum/agrum.h>
35 
36 namespace gum {
37 
38  namespace learning {
39 
45  template < template < typename > class ALLOC = std::allocator >
46  class AprioriNoApriori : public Apriori< ALLOC > {
47  public:
50 
52  using allocator_type = ALLOC< NodeId >;
53 
54 
55  // ##########################################################################
57  // ##########################################################################
59 
61 
73  const DatabaseTable< ALLOC >& database,
74  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
75  nodeId2columns =
76  Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(),
77  const allocator_type& alloc = allocator_type());
78 
81 
84  const allocator_type& alloc);
85 
88 
91  const allocator_type& alloc);
92 
94  virtual AprioriNoApriori< ALLOC >* clone() const;
95 
97  virtual AprioriNoApriori< ALLOC >* clone(const allocator_type& alloc) const;
98 
100  virtual ~AprioriNoApriori();
101 
103 
104 
105  // ##########################################################################
107  // ##########################################################################
109 
112 
115 
117 
118 
119  // ##########################################################################
121  // ##########################################################################
123 
125  virtual void setWeight(const double weight) final;
126 
128  virtual bool isOfType(const std::string& type) final;
129 
131  virtual const std::string& getType() const final;
132 
134 
141  virtual bool isInformative() const final;
142 
144 
149  virtual void
150  addAllApriori(const IdSet< ALLOC >& idset,
151  std::vector< double, ALLOC< double > >& counts) final;
152 
158  virtual void addConditioningApriori(
159  const IdSet< ALLOC >& idset,
160  std::vector< double, ALLOC< double > >& counts) final;
161 
163  };
164 
165  } /* namespace learning */
166 
167 } /* namespace gum */
168 
170 #include <agrum/learning/aprioris/aprioriNoApriori_tpl.h>
171 
172 #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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
STL namespace.
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set...
Definition: idSet.h:48
the base class for all a priori
Definition: apriori.h:50
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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:1805
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:53
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:98
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 ...