27 #ifndef GUM_LEARNING_A_PRIORI_DIRICHLET_FROM_DATABASE_H 28 #define GUM_LEARNING_A_PRIORI_DIRICHLET_FROM_DATABASE_H 32 #include <agrum/agrum.h> 33 #include <agrum/tools/stattests/recordCounter.h> 34 #include <agrum/BN/learning/aprioris/apriori.h> 45 template <
template <
typename >
class ALLOC = std::allocator >
81 const DatabaseTable< ALLOC >& learning_db,
82 const DBRowGeneratorParser< ALLOC >& apriori_parser,
92 const allocator_type& alloc);
99 const allocator_type& alloc);
135 virtual bool isOfType(
const std::string& type)
final;
151 virtual void setWeight(
const double weight)
final;
160 std::vector<
double, ALLOC<
double > >& counts)
final;
168 std::vector<
double, ALLOC<
double > >& counts)
final;
173 #ifndef DOXYGEN_SHOULD_SKIP_THIS 177 RecordCounter< ALLOC > _counter_;
183 double _internal_weight_;
193 #include <agrum/BN/learning/aprioris/aprioriDirichletFromDatabase_tpl.h> AprioriDirichletFromDatabase(const AprioriDirichletFromDatabase< ALLOC > &from)
copy constructor
virtual void addAllApriori(const IdCondSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts) final
adds the apriori to a counting vector corresponding to the idset
virtual bool isOfType(const std::string &type) final
indicates whether an apriori is of a certain type
INLINE void emplace(Args &&... args)
virtual AprioriDirichletFromDatabase< ALLOC > * clone() const
virtual copy constructor
virtual void addConditioningApriori(const IdCondSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts) final
adds the apriori to a counting vectordefined over the right hand side of the idset ...
virtual bool isInformative() const final
indicates whether the apriori is potentially informative
AprioriDirichletFromDatabase(AprioriDirichletFromDatabase< ALLOC > &&from)
move constructor
A dirichlet priori: computes its N'_ijk from a database.
virtual void setWeight(const double weight) final
sets the weight of the a priori (kind of effective sample size)
AprioriDirichletFromDatabase< ALLOC > & operator=(AprioriDirichletFromDatabase< ALLOC > &&from)
move operator
virtual ~AprioriDirichletFromDatabase()
destructor
AprioriDirichletFromDatabase(const AprioriDirichletFromDatabase< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
AprioriDirichletFromDatabase(const DatabaseTable< ALLOC > &learning_db, const DBRowGeneratorParser< ALLOC > &apriori_parser, 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
AprioriDirichletFromDatabase(AprioriDirichletFromDatabase< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
virtual const std::string & getType() const final
returns the type of the apriori
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
virtual AprioriDirichletFromDatabase< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
AprioriDirichletFromDatabase< ALLOC > & operator=(const AprioriDirichletFromDatabase< ALLOC > &from)
copy operator