aGrUM  0.13.2
gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc > Class Template Reference

the internal apriori for the BDeu score (N' / (r_i * q_i)Some scores include an apriori. More...

#include <scoreInternalBDeuApriori.h>

+ Inheritance diagram for gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >:
+ Collaboration diagram for gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >:

Public Member Functions

Constructors / Destructors
 ScoreInternalBDeuApriori ()
 default constructor More...
 
virtual ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc > * copyFactory () const final
 virtual copy constructor More...
 
 ScoreInternalBDeuApriori (const ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc > &from)
 copy constructor More...
 
 ScoreInternalBDeuApriori (ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc > &&from)
 move constructor More...
 
virtual ~ScoreInternalBDeuApriori ()
 destructor More...
 
Accessors / Modifiers
virtual void insertScoreApriori (const std::vector< Size > &modalities, std::vector< std::vector< double, CountAlloc > > &counts, const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &target_nodesets, const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &conditioning_nodesets) final
 insert the internal score apriori into a set of countings More...
 
void setEffectiveSampleSize (double ess)
 sets the effective sample size of the internal apriori More...
 
Accessors / Modifiers
virtual bool isInformative () const
 indicates whether the apriori is potentially informative More...
 

Detailed Description

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
class gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >

the internal apriori for the BDeu score (N' / (r_i * q_i)

Some scores include an apriori.

For instance, the K2 score is a BD score with a Laplace Apriori ( smoothing(1) ). BDeu is a BD score with a N'/(r_i * q_i) apriori, where N' is an effective sample size and r_i is the domain size of the target variable and q_i is the domain size of the Cartesian product of its parents. The goal of the score's internal apriori classes is to enable to account for these aprioris outside the score, e.g., when performing parameter estimation. It is important to note that, to be meaningfull a structure + parameter learning requires that the same aprioris are taken into account during structure learning and parameter learning.

Definition at line 57 of file scoreInternalBDeuApriori.h.

Constructor & Destructor Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::ScoreInternalBDeuApriori ( )

default constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::ScoreInternalBDeuApriori ( const ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc > &  from)

copy constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::ScoreInternalBDeuApriori ( ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc > &&  from)

move constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::~ScoreInternalBDeuApriori ( )
virtual

destructor

Member Function Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >* gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::copyFactory ( ) const
finalvirtual
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::insertScoreApriori ( const std::vector< Size > &  modalities,
std::vector< std::vector< double, CountAlloc > > &  counts,
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &  target_nodesets,
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &  conditioning_nodesets 
)
finalvirtual

insert the internal score apriori into a set of countings

Implements gum::learning::ScoreInternalApriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual bool gum::learning::ScoreInternalApriori< IdSetAlloc, CountAlloc >::isInformative ( ) const
virtualinherited

indicates whether the apriori is potentially informative

Basically, only the NoApriori is uninformative. However, it may happen that, under some circonstances, an apriori, which is usually not equal to the NoApriori, becomes equal to it. In this case, if the apriori can detect this case, it shall informa the classes that use it that it is temporarily uninformative. These classes will then be able to speed-up their code by avoiding to take into account the apriori in their computations.

Reimplemented in gum::learning::ScoreInternalNoApriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::setEffectiveSampleSize ( double  ess)

sets the effective sample size of the internal apriori

Member Data Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
double gum::learning::ScoreInternalBDeuApriori< IdSetAlloc, CountAlloc >::__ess {1.0f}
private

the effective sample size of the internal apriori

Definition at line 106 of file scoreInternalBDeuApriori.h.


The documentation for this class was generated from the following file: