28 #ifndef GUM_LEARNING_SCORE_BDEU_H 29 #define GUM_LEARNING_SCORE_BDEU_H 33 #include <agrum/agrum.h> 34 #include <agrum/tools/core/math/math_utils.h> 35 #include <agrum/tools/core/math/gammaLog2.h> 36 #include <agrum/BN/learning/scores_and_tests/score.h> 37 #include <agrum/BN/learning/aprioris/aprioriBDeu.h> 57 template <
template <
typename >
class ALLOC = std::allocator >
89 ScoreBDeu(
const DBRowGeneratorParser< ALLOC >& parser,
90 const Apriori< ALLOC >& apriori,
91 const std::vector< std::pair< std::size_t, std::size_t >,
92 ALLOC< std::pair< std::size_t, std::size_t > > >& ranges,
113 ScoreBDeu(
const DBRowGeneratorParser< ALLOC >& parser,
114 const Apriori< ALLOC >& apriori,
120 ScoreBDeu(
const ScoreBDeu< ALLOC >& from);
123 ScoreBDeu(
const ScoreBDeu< ALLOC >& from,
const allocator_type& alloc);
129 ScoreBDeu(ScoreBDeu< ALLOC >&& from,
const allocator_type& alloc);
197 static std::string
isAprioriCompatible(
const std::string& apriori_type,
double weight = 1.0f);
209 virtual double score_(
const IdCondSet< ALLOC >& idset)
final;
212 #ifndef DOXYGEN_SHOULD_SKIP_THIS 216 AprioriBDeu< ALLOC > _internal_apriori_;
219 GammaLog2 _gammalog2_;
229 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 230 extern template class gum::learning::ScoreBDeu<>;
235 #include <agrum/BN/learning/scores_and_tests/scoreBDeu_tpl.h> virtual ScoreBDeu< ALLOC > * clone() const
virtual copy constructor
the class for computing BDeu scores
ScoreBDeu(const ScoreBDeu< ALLOC > &from)
copy constructor
virtual const Apriori< ALLOC > & internalApriori() const final
returns the internal apriori of the score
virtual ScoreBDeu< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
ScoreBDeu(ScoreBDeu< ALLOC > &&from)
move constructor
ScoreBDeu(const DBRowGeneratorParser< ALLOC > &parser, const Apriori< ALLOC > &apriori, 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
INLINE void emplace(Args &&... args)
ScoreBDeu< ALLOC > & operator=(ScoreBDeu< ALLOC > &&from)
move operator
virtual ~ScoreBDeu()
destructor
ScoreBDeu(const ScoreBDeu< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
ScoreBDeu(ScoreBDeu< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
static std::string isAprioriCompatible(const Apriori< ALLOC > &apriori)
indicates whether the apriori is compatible (meaningful) with the score
void setEffectiveSampleSize(double ess)
sets the effective sample size of the internal apriori
virtual std::string isAprioriCompatible() const final
indicates whether the apriori is compatible (meaningful) with the score
ScoreBDeu< ALLOC > & operator=(const ScoreBDeu< ALLOC > &from)
copy operator
virtual double score_(const IdCondSet< ALLOC > &idset) final
returns the score for a given IdCondSet
static std::string isAprioriCompatible(const std::string &apriori_type, double weight=1.0f)
indicates whether the apriori is compatible (meaningful) with the score
ScoreBDeu(const DBRowGeneratorParser< ALLOC > &parser, const Apriori< ALLOC > &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
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)