aGrUM  0.13.2
gum::learning::ScoreInternalApriori< IdSetAlloc, CountAlloc > Class Template Referenceabstract

the base class for all the score's internal apriorisSome scores include an apriori. More...

#include <scoreInternalApriori.h>

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

Public Member Functions

Constructors / Destructors
 ScoreInternalApriori ()
 default constructor More...
 
virtual ScoreInternalApriori< IdSetAlloc, CountAlloc > * copyFactory () const =0
 virtual copy constructor More...
 
virtual ~ScoreInternalApriori ()
 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)=0
 insert the internal score apriori into a set of countings More...
 
virtual bool isInformative () const
 indicates whether the apriori is potentially informative More...
 

Protected Member Functions

 ScoreInternalApriori (const ScoreInternalApriori< IdSetAlloc, CountAlloc > &from)
 copy constructor More...
 
 ScoreInternalApriori (ScoreInternalApriori< IdSetAlloc, CountAlloc > &&from)
 move constructor More...
 

Detailed Description

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

the base class for all the score's internal aprioris

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 66 of file scoreInternalApriori.h.

Constructor & Destructor Documentation

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

default constructor

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

destructor

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

copy constructor

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

move constructor

Member Function Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual ScoreInternalApriori< IdSetAlloc, CountAlloc >* gum::learning::ScoreInternalApriori< IdSetAlloc, CountAlloc >::copyFactory ( ) const
pure virtual
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::ScoreInternalApriori< 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 
)
pure virtual
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual bool gum::learning::ScoreInternalApriori< IdSetAlloc, CountAlloc >::isInformative ( ) const
virtual

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 >.


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