31 #ifndef GUM_LEARNING_SCORE_BD_H 32 #define GUM_LEARNING_SCORE_BD_H 36 #include <agrum/agrum.h> 37 #include <agrum/tools/core/math/math_utils.h> 38 #include <agrum/tools/core/math/gammaLog2.h> 39 #include <agrum/BN/learning/scores_and_tests/score.h> 40 #include <agrum/BN/learning/aprioris/aprioriNoApriori.h> 63 template <
template <
typename >
class ALLOC = std::allocator >
95 ScoreBD(
const DBRowGeneratorParser< ALLOC >& parser,
96 const Apriori< ALLOC >& apriori,
97 const std::vector< std::pair< std::size_t, std::size_t >,
98 ALLOC< std::pair< std::size_t, std::size_t > > >& ranges,
119 ScoreBD(
const DBRowGeneratorParser< ALLOC >& parser,
120 const Apriori< ALLOC >& apriori,
126 ScoreBD(
const ScoreBD< ALLOC >& from);
129 ScoreBD(
const ScoreBD< ALLOC >& from,
const allocator_type& alloc);
132 ScoreBD(ScoreBD< ALLOC >&& from);
135 ScoreBD(ScoreBD< ALLOC >&& from,
const allocator_type& alloc);
200 static std::string
isAprioriCompatible(
const std::string& apriori_type,
double weight = 1.0f);
212 virtual double score_(
const IdCondSet< ALLOC >& idset)
final;
215 #ifndef DOXYGEN_SHOULD_SKIP_THIS 219 AprioriNoApriori< ALLOC > _internal_apriori_;
222 GammaLog2 _gammalog2_;
232 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 233 extern template class gum::learning::ScoreBD<>;
238 #include <agrum/BN/learning/scores_and_tests/scoreBD_tpl.h> virtual const Apriori< ALLOC > & internalApriori() const final
returns the internal apriori of the score
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
ScoreBD< ALLOC > & operator=(ScoreBD< ALLOC > &&from)
move operator
ScoreBD(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)
the class for computing Bayesian Dirichlet (BD) log2 scores
ScoreBD(const ScoreBD< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
ScoreBD(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
virtual ~ScoreBD()
destructor
static std::string isAprioriCompatible(const Apriori< ALLOC > &apriori)
indicates whether the apriori is compatible (meaningful) with the score
virtual ScoreBD< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
ScoreBD< ALLOC > & operator=(const ScoreBD< ALLOC > &from)
copy operator
virtual std::string isAprioriCompatible() const final
indicates whether the apriori is compatible (meaningful) with the score
ScoreBD(const ScoreBD< ALLOC > &from)
copy constructor
ScoreBD(ScoreBD< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
virtual ScoreBD< ALLOC > * clone() const
virtual copy constructor
ScoreBD(ScoreBD< ALLOC > &&from)
move constructor
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)