31 #ifndef GUM_LEARNING_SCORE_K2_H 32 #define GUM_LEARNING_SCORE_K2_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/aprioriK2.h> 59 template <
template <
typename >
class ALLOC = std::allocator >
91 ScoreK2(
const DBRowGeneratorParser< ALLOC >& parser,
92 const Apriori< ALLOC >& apriori,
93 const std::vector< std::pair< std::size_t, std::size_t >,
94 ALLOC< std::pair< std::size_t, std::size_t > > >& ranges,
115 ScoreK2(
const DBRowGeneratorParser< ALLOC >& parser,
116 const Apriori< ALLOC >& apriori,
122 ScoreK2(
const ScoreK2< ALLOC >& from);
125 ScoreK2(
const ScoreK2< ALLOC >& from,
const allocator_type& alloc);
128 ScoreK2(ScoreK2< ALLOC >&& from);
131 ScoreK2(ScoreK2< ALLOC >&& from,
const allocator_type& alloc);
196 static std::string
isAprioriCompatible(
const std::string& apriori_type,
double weight = 1.0f);
208 virtual double score_(
const IdCondSet< ALLOC >& idset)
final;
211 #ifndef DOXYGEN_SHOULD_SKIP_THIS 215 AprioriK2< ALLOC > _internal_apriori_;
218 GammaLog2 _gammalog2_;
229 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 230 extern template class gum::learning::ScoreK2<>;
235 #include <agrum/BN/learning/scores_and_tests/scoreK2_tpl.h> ScoreK2(ScoreK2< ALLOC > &&from)
move constructor
virtual double score_(const IdCondSet< ALLOC > &idset) final
returns the score for a given IdCondSet
ScoreK2(ScoreK2< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
INLINE void emplace(Args &&... args)
static std::string isAprioriCompatible(const Apriori< ALLOC > &apriori)
indicates whether the apriori is compatible (meaningful) with the score
the class for computing K2 scores (actually their log2 value)
ScoreK2(const ScoreK2< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
ScoreK2< ALLOC > & operator=(const ScoreK2< ALLOC > &from)
copy operator
virtual ScoreK2< ALLOC > * clone() const
virtual copy constructor
ScoreK2(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
ScoreK2< ALLOC > & operator=(ScoreK2< ALLOC > &&from)
move operator
virtual const Apriori< ALLOC > & internalApriori() const final
returns the internal apriori of the score
virtual std::string isAprioriCompatible() const final
indicates whether the apriori is compatible (meaningful) with the score
virtual ~ScoreK2()
destructor
static std::string isAprioriCompatible(const std::string &apriori_type, double weight=1.0f)
indicates whether the apriori is compatible (meaningful) with the score
ScoreK2(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
virtual ScoreK2< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
ScoreK2(const ScoreK2< ALLOC > &from)
copy constructor
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)