aGrUM  0.16.0
aprioriK2.h
Go to the documentation of this file.
1 
28 #ifndef GUM_LEARNING_A_PRIORI_K2_H
29 #define GUM_LEARNING_A_PRIORI_K2_H
30 
31 #include <vector>
32 
33 #include <agrum/agrum.h>
35 
36 namespace gum {
37 
38  namespace learning {
39 
51  template < template < typename > class ALLOC = std::allocator >
52  class AprioriK2 : public AprioriSmoothing< ALLOC > {
53  public:
56 
58  using allocator_type = ALLOC< NodeId >;
59 
60 
61  // ##########################################################################
63  // ##########################################################################
65 
67 
78  AprioriK2(const DatabaseTable< ALLOC >& database,
79  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
80  nodeId2columns =
81  Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(),
82  const allocator_type& alloc = allocator_type());
83 
85  AprioriK2(const AprioriK2< ALLOC >& from);
86 
88  AprioriK2(const AprioriK2< ALLOC >& from, const allocator_type& alloc);
89 
92 
94  AprioriK2(AprioriK2< ALLOC >&& from, const allocator_type& alloc);
95 
97  virtual AprioriK2< ALLOC >* clone() const;
98 
100  virtual AprioriK2< ALLOC >* clone(const allocator_type& alloc) const;
101 
103  virtual ~AprioriK2();
104 
106 
107 
108  // ##########################################################################
110  // ##########################################################################
112 
115 
118 
120 
121 
122  // ##########################################################################
124  // ##########################################################################
126 
128  virtual void setWeight(const double weight) final;
129 
131  };
132 
133  } /* namespace learning */
134 
135 } /* namespace gum */
136 
139 
140 #endif /* GUM_LEARNING_A_PRIORI_K2_H */
virtual void setWeight(const double weight) final
dummy set weight function: in K2, weights are always equal to 1
AprioriK2(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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
virtual AprioriK2< ALLOC > * clone() const
virtual copy constructor
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~AprioriK2()
destructor
AprioriK2< ALLOC > & operator=(const AprioriK2< ALLOC > &from)
copy operator
double weight() const
returns the weight assigned to the apriori
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1805
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class representing a tabular database as used by learning tasks.
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Definition: aprioriK2.h:58
the internal apriori for the K2 score = Laplace AprioriK2 is a BD score with a Laplace apriori (i...
Definition: aprioriK2.h:52
the smooth a priori: adds a weight w to all the countings
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Definition: apriori.h:53
Size NodeId
Type for node ids.
Definition: graphElements.h:98