Abstract class, defines interface for feature selection criterion classes. More...
#include <criterion.hpp>
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) | |
Abstract class, defines interface for feature selection criterion classes.
|
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 > >.
|
pure virtual |
Scores the given feature subset; higher is better (FST4 searches maximize).
| result | set to the criterion value on success; left unspecified on failure |
| sub | the (fixed) subset to evaluate – only its selected features are read |
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 >.
|
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 >.
|
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.
|
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.