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

Abstract class, defines interface for classes that enable collecting multiple results. More...

#include <result_tracker.hpp>

Inheritance diagram for FST::Result_Tracker< RETURNTYPE, SUBSET >:
FST::Clonable FST::Clonable_Impl< Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, Result_Tracker< RETURNTYPE, SUBSET >, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP > FST::Clonable_Impl< Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, Result_Tracker< RETURNTYPE, SUBSET >, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP > FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > FST::Clonable_Impl< Result_Tracker_Feature_Stats< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP > FST::Clonable_Impl< Result_Tracker_Regularizer< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET, CRITERION >, Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP > FST::Result_Tracker_Feature_Stats< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > FST::Result_Tracker_Regularizer< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET, CRITERION >

Classes

struct  ResultRec
 Structure to hold [subset,criterion value] temporary solutions in the course of search. More...

Public Types

typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to a tracked feature subset
typedef ResultRec * PResultRec
 raw pointer to a ResultRec, as used by get_first()/get_next() iteration

Public Member Functions

 Result_Tracker (const Result_Tracker &rt)
 copies the output-detail setting only – concrete trackers copy their own collected results separately
virtual bool add (const RETURNTYPE value, const PSubset sub)=0
 records one (value, subset) result; returns false if the tracker declines to keep it (concrete trackers may restrict by subset size, a value margin from the best known result, or a capacity limit – see the concrete tracker for its actual inclusion rule)
virtual void clear ()=0
 discards all recorded results
virtual std::size_t size () const =0
 number of results currently held (std::size_t rather than 'long': on LLP64 platforms 'long' is 32 bits and would narrow the container's own size type)
virtual bool get_first (PResultRec &r)=0
 starts an iteration over the held results, best first; false if the tracker holds nothing. The record r points into the tracker's own storage and is invalidated by any add(), join() or clear()
virtual bool get_next (PResultRec &r)=0
 hands out the next held result; false once the iteration is exhausted. A tracker has a single shared iteration cursor, so two iterations of the same object cannot be interleaved
virtual void join (Result_Tracker &src)
 adds the contents of src to this tracker, one add() per record, so this tracker's own inclusion rules apply; src is only read, but its iteration cursor is consumed
Result_Tracker * clone () const override
Result_Tracker * sharing_clone () const override
Result_Tracker * stateless_clone () const override=0
void set_output_detail (OutputDetail detail)
 sets the amount of information that is logged to output stream throughout the course of search
OutputDetail get_output_detail () const
 the currently configured output detail level
bool output_normal () const
 true unless output detail is SILENT
bool output_detailed () const
 true only at the DETAILED output level
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

Protected Attributes

OutputDetail _detail
 the output detail level set via set_output_detail(); read by output_normal()/output_detailed()

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::Result_Tracker< RETURNTYPE, SUBSET >

Abstract class, defines interface for classes that enable collecting multiple results.

The reason to do this is to enable a) feature preference fragility workaround, i.e., employing secondary criterion to select a result that may prove better than the seemingly best one, b) evaluation of feature selection stability, c) additional feature selection schemes, etc..

Member Function Documentation

◆ add()

template<class RETURNTYPE, class SUBSET>
virtual bool FST::Result_Tracker< RETURNTYPE, SUBSET >::add ( const RETURNTYPE value,
const PSubset sub )
pure virtual

records one (value, subset) result; returns false if the tracker declines to keep it (concrete trackers may restrict by subset size, a value margin from the best known result, or a capacity limit – see the concrete tracker for its actual inclusion rule)

Implemented in FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, and FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >.

◆ clear()

template<class RETURNTYPE, class SUBSET>
virtual void FST::Result_Tracker< RETURNTYPE, SUBSET >::clear ( )
pure virtual

◆ clone()

template<class RETURNTYPE, class SUBSET>
Result_Tracker * FST::Result_Tracker< RETURNTYPE, SUBSET >::clone ( ) const
inlineoverridevirtual

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.

◆ get_first()

template<class RETURNTYPE, class SUBSET>
virtual bool FST::Result_Tracker< RETURNTYPE, SUBSET >::get_first ( PResultRec & r)
pure virtual

starts an iteration over the held results, best first; false if the tracker holds nothing. The record r points into the tracker's own storage and is invalidated by any add(), join() or clear()

Implemented in FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, and FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >.

◆ get_next()

template<class RETURNTYPE, class SUBSET>
virtual bool FST::Result_Tracker< RETURNTYPE, SUBSET >::get_next ( PResultRec & r)
pure virtual

hands out the next held result; false once the iteration is exhausted. A tracker has a single shared iteration cursor, so two iterations of the same object cannot be interleaved

Implemented in FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, and FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >.

◆ join()

template<class RETURNTYPE, class SUBSET>
void FST::Result_Tracker< RETURNTYPE, SUBSET >::join ( Result_Tracker< RETURNTYPE, SUBSET > & src)
virtual

adds the contents of src to this tracker, one add() per record, so this tracker's own inclusion rules apply; src is only read, but its iteration cursor is consumed

Reimplemented in FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >.

◆ sharing_clone()

template<class RETURNTYPE, class SUBSET>
Result_Tracker * FST::Result_Tracker< 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.

◆ size()

template<class RETURNTYPE, class SUBSET>
virtual std::size_t FST::Result_Tracker< RETURNTYPE, SUBSET >::size ( ) const
pure virtual

number of results currently held (std::size_t rather than 'long': on LLP64 platforms 'long' is 32 bits and would narrow the container's own size type)

Implemented in FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, and FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >.

◆ stateless_clone()


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.