Implements Bhattacharyya distance based on multinomial model to serve as feature selection criterion.
More...
|
|
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
|
|
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
|
|
typedef std::shared_ptr< SUBSET > | PSubset |
| | shared pointer to the feature subset being evaluated
|
|
typedef std::shared_ptr< SUBSET > | PSubset |
| | shared pointer to the feature subset being evaluated
|
|
| 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
|
| 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)
|
| 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
|
| Criterion * | sharing_clone () const override |
| Criterion * | stateless_clone () const override |
| 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
|
|
|
| Criterion_Multinomial (const Criterion_Multinomial &cm) |
| | Copy-constructor; deep-copies _model.
|
|
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)
|
|
std::unique_ptr< Model_Multinomial< DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > > | _model |
| | the learned per-class multinomial (term-probability) model
|
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.
template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
writes a human-readable identification of the object; base default writes nothing
Reimplemented from FST::Clonable.