Abstract class, defines interface for classes that enable collecting multiple results. More...
#include <result_tracker.hpp>
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) | |
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..
|
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 >.
|
pure virtual |
discards all recorded results
Implemented in FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, and FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >.
|
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.
|
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 >.
|
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 >.
|
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 >.
|
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.
|
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 >.
|
overridepure virtual |
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.
Implemented in 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_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 >, and FST::Clonable_Impl< Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET >, Result_Tracker< RETURNTYPE, SUBSET >, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP >.