Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches
FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > Class Template Reference

Implements Bhattacharyya distance based on multinomial model to serve as feature selection criterion. More...

#include <criterion_multinom_bhattacharyya.hpp>

Inheritance diagram for FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >:
FST::Clonable_Impl< Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > > FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > FST::Criterion_Filter< RETURNTYPE, SUBSET > FST::Criterion< RETURNTYPE, SUBSET > FST::Clonable

Public Types

typedef Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > parent
 base class: the multinomial-model learning/interface skeleton
typedef Clonable_Impl< Criterion_Multinomial_Bhattacharyya, parent > parent_impl
 implements clone(); sharing/stateless_clone throw in Criterion
typedef std::shared_ptr< DATAACCESSOR > PDataAccessor
 shared pointer to the data accessor the model is learned from
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to the feature subset being evaluated
Public Types inherited from FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >
typedef std::shared_ptr< DATAACCESSOR > PDataAccessor
 shared pointer to the data accessor the model is learned from
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to the feature subset being evaluated
Public Types inherited from FST::Criterion_Filter< RETURNTYPE, SUBSET >
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to the feature subset being evaluated
Public Types inherited from FST::Criterion< RETURNTYPE, SUBSET >
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to the feature subset being evaluated

Public Member Functions

virtual bool evaluate (RETURNTYPE &result, const PSubset sub) override
 Scores sub: the general multinomial Bhattacharyya distance over class pairs, or (on a singleton) the individual Bhattacharyya term.
virtual bool initialize (PDataAccessor da) override
 learns the model (parent::initialize()) and resets the lazily-computed individual-Bhattacharyya cache
virtual std::ostream & print (std::ostream &os) const override
 writes a human-readable identification of the object; base default writes nothing
Public Member Functions inherited from FST::Clonable_Impl< Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > >
Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > * clone () const override
 dispatches to the DEEP_KIND mechanism (default CLONE_DEEP: Derived's copy-constructor)
Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > * sharing_clone () const override
 dispatches to the SHARING_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention)
Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > * stateless_clone () const override
 dispatches to the STATELESS_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention)
Public Member Functions inherited from FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >
virtual bool is_monotonic () const override
DIMTYPE get_n () const
 the full (raw, unnarrowed) feature count the model was learned for
DIMTYPE get_d () const
 the currently active (narrowed) feature count
Public Member Functions inherited from FST::Criterion< RETURNTYPE, SUBSET >
Criterion * sharing_clone () const override
Criterion * stateless_clone () const override
Public Member Functions inherited from FST::Clonable
bool is_clone () const
bool is_sharing () const
 true if this instance is a sharing_clone() result (referencing, not owning, the source's structures)
bool is_sharing_clone () const
 true if this instance is BOTH a clone and sharing – i.e. specifically a sharing_clone() result, not a clone()/stateless_clone() one

Private Member Functions

 Criterion_Multinomial_Bhattacharyya (const Criterion_Multinomial_Bhattacharyya &cmb)
 Copy-constructor; copies _IB_computed (base _model copied by parent_impl).

Private Attributes

friend parent_impl
bool _IB_computed
 true once the per-feature individual-Bhattacharyya cache (Model_Multinomial::get_IB()) has been computed for the current model

Additional Inherited Members

Protected Member Functions inherited from FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >
 Criterion_Multinomial (const Criterion_Multinomial &cm)
 Copy-constructor; deep-copies _model.
Protected Member Functions inherited from FST::Clonable
void set_cloned (const bool cloned=true)
 marks/unmarks this instance as a clone; call from clone()/stateless_clone() overrides (Clonable_Impl does this automatically)
void set_sharing (const bool sharing=true)
 marks/unmarks this instance as sharing (see is_sharing())
void set_sharing_cloned (const bool cloned=true, const bool sharing=true)
 sets both flags at once; call from sharing_clone() overrides (Clonable_Impl does this automatically)
Protected Attributes inherited from FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >
std::unique_ptr< Model_Multinomial< DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > > _model
 the learned per-class multinomial (term-probability) model

Detailed Description

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
class FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >

Implements Bhattacharyya distance based on multinomial model to serve as feature selection criterion.

Warning
The value returned depends on the subset SIZE in kind, not only in magnitude: for d > 1 it is the general multinomial Bhattacharyya distance (a prior-weighted sum over class pairs of -log of the Bhattacharyya coefficient of the two term distributions, scaled by the average document length), while for d == 1 the general form degenerates and the criterion returns the cached INDIVIDUAL Bhattacharyya value of that one feature instead. The two are on different scales, so values obtained for singletons must not be compared with values obtained for larger subsets. In practice this matters when a search visits subsets of size 1 (e.g. the first step of a forward sequential search or a ranking search) - the ordering WITHIN each size is meaningful regardless.

Member Function Documentation

◆ evaluate()

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
bool FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::evaluate ( RETURNTYPE & result,
const PSubset sub )
overridevirtual

Scores sub: the general multinomial Bhattacharyya distance over class pairs, or (on a singleton) the individual Bhattacharyya term.

Implements FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >.

◆ initialize()

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
bool FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::initialize ( PDataAccessor da)
overridevirtual

learns the model (parent::initialize()) and resets the lazily-computed individual-Bhattacharyya cache

Reimplemented from FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >.

◆ print()

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
virtual std::ostream & FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::print ( std::ostream & os) const
inlineoverridevirtual

writes a human-readable identification of the object; base default writes nothing

Reimplemented from FST::Clonable.

Member Data Documentation

◆ parent_impl

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
friend FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::parent_impl
private

grants Clonable_Impl access to the copy-constructor


The documentation for this class was generated from the following file:
Copyright © 2000–present ÚTIA, Institute of Information Theory and Automation of the Czech Academy of Sciences · Contacts · This site sets no cookies and uses no analytics.