Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches
FST::Criterion< RETURNTYPE, SUBSET > Class Template Referenceabstract

Abstract class, defines interface for feature selection criterion classes. More...

#include <criterion.hpp>

Inheritance diagram for FST::Criterion< RETURNTYPE, SUBSET >:
FST::Clonable FST::Clonable_Impl< Criterion_Negative, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Subset_Size, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Sum_Of_Weights, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Wrapper, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Extern_Value< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Negative< CRITERION, RETURNTYPE, SUBSET >, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Subset_Size< RETURNTYPE, SUBSET >, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Sum_Of_Weights< RETURNTYPE, DIMTYPE, SUBSET >, Criterion< RETURNTYPE, SUBSET > > FST::Clonable_Impl< Criterion_Wrapper< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR >, Criterion< RETURNTYPE, SUBSET > > FST::Criterion_Filter< RETURNTYPE, SUBSET >

Public Types

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)=0
 Scores the given feature subset; higher is better (FST4 searches maximize).
virtual bool is_monotonic () const
Criterion * clone () const override=0
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
virtual std::ostream & print (std::ostream &os) const
 writes a human-readable identification of the object; base default writes nothing

Additional Inherited Members

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)

Detailed Description

template<class RETURNTYPE, class SUBSET>
class FST::Criterion< RETURNTYPE, SUBSET >

Abstract class, defines interface for feature selection criterion classes.

Member Function Documentation

◆ clone()

template<class RETURNTYPE, class SUBSET>
Criterion * FST::Criterion< RETURNTYPE, SUBSET >::clone ( ) const
overridepure virtual

create 1:1 independent clone of the current object. The caller owns the returned object. Families that cannot support a given clone kind implement it to throw fst_error; Clonable_Impl's CLONE_INHERIT slot defers to such a body.

Implements FST::Clonable.

Implemented in FST::Clonable_Impl< Criterion_Extern_Value< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > >, FST::Clonable_Impl< Criterion_Multinomial_MI< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > >, FST::Clonable_Impl< Criterion_Negative, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Negative< CRITERION, RETURNTYPE, SUBSET >, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Normal_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Normal< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > >, FST::Clonable_Impl< Criterion_Normal_Divergence< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Normal< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > >, FST::Clonable_Impl< Criterion_Normal_GMahalanobis< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, Criterion_Normal< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > >, FST::Clonable_Impl< Criterion_Subset_Size, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Subset_Size< RETURNTYPE, SUBSET >, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Sum_Of_Weights, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Sum_Of_Weights< RETURNTYPE, DIMTYPE, SUBSET >, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Wrapper, Criterion< RETURNTYPE, SUBSET > >, FST::Clonable_Impl< Criterion_Wrapper< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR >, Criterion< RETURNTYPE, SUBSET > >, and FST::Clonable_Impl< Criterion_Wrapper_Bias_Estimate< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR >, Criterion_Wrapper< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR > >.

◆ evaluate()

template<class RETURNTYPE, class SUBSET>
virtual bool FST::Criterion< RETURNTYPE, SUBSET >::evaluate ( RETURNTYPE & result,
const PSubset sub )
pure virtual

Scores the given feature subset; higher is better (FST4 searches maximize).

Parameters
resultset to the criterion value on success; left unspecified on failure
subthe (fixed) subset to evaluate – only its selected features are read
Returns
false if the subset cannot be evaluated at all (e.g. too small for the model, or singular statistics). This is NOT a per-candidate reject: callers treat it as fatal for the current search step or run – the sequential-step candidate evaluator marks its whole batch failed, streaming searches abort, and Branch & Bound throws. A criterion that can legitimately be undefined on some subsets must guard against reaching those subsets another way (e.g. a minimum-subset-size constraint), not by relying on evaluate() to skip them.

Implemented in FST::Criterion_Extern_Value< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, FST::Criterion_Multinomial_MI< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, FST::Criterion_Negative< CRITERION, RETURNTYPE, SUBSET >, FST::Criterion_Normal< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, FST::Criterion_Subset_Size< RETURNTYPE, SUBSET >, FST::Criterion_Sum_Of_Weights< RETURNTYPE, DIMTYPE, SUBSET >, FST::Criterion_Wrapper< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR >, and FST::Criterion_Wrapper_Bias_Estimate< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR >.

◆ is_monotonic()

template<class RETURNTYPE, class SUBSET>
virtual bool FST::Criterion< RETURNTYPE, SUBSET >::is_monotonic ( ) const
inlinevirtual

Declares monotonicity with respect to subset cardinality: true means removing a feature can NEVER increase the criterion value. Branch & Bound prunes on this property, so ALL of its optimality guarantees rest on this declaration - and the library cannot verify it, it is an assertion made by the criterion's author. A false declaration silently turns Branch & Bound into a heuristic that may skip the optimum. Search_Branch_And_Bound therefore prints a warning at search start when the supplied criterion does not declare the property, and the fst4 command-line tool refuses the --search bb-* algorithms outright for such a criterion. Defaults to false: user-supplied criteria should override to true only if monotonicity provably holds. The built-in normal-model and multinomial filters declare true (see Criterion_Normal and Criterion_Multinomial); wrapper criteria and the adapter criteria (negative/subset-size/sum-of-weights) deliberately keep the false default.

Reimplemented in FST::Criterion_Extern_Value< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, FST::Criterion_Multinomial< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >, and FST::Criterion_Normal< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >.

◆ sharing_clone()

template<class RETURNTYPE, class SUBSET>
Criterion * FST::Criterion< RETURNTYPE, SUBSET >::sharing_clone ( ) const
inlineoverridevirtual

create equivalent clone of the current object, permitting read-only access to structures in the source object (allows referencing instead of copying of large memory structures). may be faster and save space but requires more caution with respect to concurrency Use example: Data_Accessor memory data representation cloning

Implements FST::Clonable.

◆ stateless_clone()

template<class RETURNTYPE, class SUBSET>
Criterion * FST::Criterion< RETURNTYPE, SUBSET >::stateless_clone ( ) const
inlineoverridevirtual

create clone of the current object, ignoring internal temporary structures to save speed. Does not replicate exact object state. The clone must be used carefully in a way that ensures internal structure re-initialization Use example: Data_Splitter cloning or Classifier_LIBSVM cloning due to inability to clone external structures defined in LibSVM

Implements FST::Clonable.


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.