Collects multiple results. Enables eventual selection of alternative solution based on secondary criterion.
More...
|
|
typedef Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > | parent |
| | base class alias
|
|
typedef Clonable_Impl< Result_Tracker_Regularizer, parent, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP > | parent_impl |
| | implements stateless_clone() via Clonable_Impl; clone()/sharing_clone() defer to Result_Tracker's throwing defaults (see CLONE_INHERIT)
|
|
typedef parent::ResultRec | ResultRec |
| | one tracked [value,subset] result record, as defined by Result_Tracker
|
|
typedef ResultRec * | PResultRec |
| | raw pointer to a ResultRec
|
|
typedef std::shared_ptr< SUBSET > | PSubset |
| | shared pointer to a feature subset
|
|
typedef std::shared_ptr< CRITERION > | PCriterion |
| | shared pointer to a criterion (the secondary criterion used to re-rank tracked results)
|
|
typedef Result_Tracker< RETURNTYPE, SUBSET > | parent |
| | the abstract Result_Tracker interface this class implements
|
|
typedef Clonable_Impl< Result_Tracker_Dupless, parent, CLONE_INHERIT, CLONE_INHERIT, CLONE_DEEP > | parent_impl |
| | implements stateless_clone() via the copy-constructor (CLONE_DEEP); clone()/sharing_clone() are inherited from Result_Tracker, which throws for both
|
|
typedef parent::ResultRec | ResultRec |
| | see Result_Tracker::ResultRec
|
|
typedef parent::PResultRec | PResultRec |
| | see Result_Tracker::PResultRec
|
| typedef std::shared_ptr< SUBSET > | PSubset |
|
typedef std::list< ResultRec >::const_iterator | CONSTRESULTSITER |
| | read-only iterator over results, for use by subclasses/friends inspecting the collected results
|
|
typedef std::list< ResultRec >::iterator | RESULTSITER |
| | mutable iterator over results, as returned by begin()/end()
|
|
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
|
|
|
| Result_Tracker_Regularizer (const IDXTYPE capacity_limit=0) |
| | capacity_limit forwarded to Result_Tracker_Dupless (0 = unlimited)
|
|
| Result_Tracker_Regularizer (const Result_Tracker_Regularizer &rtr) |
| | the copy starts with a fresh (non-searching) equivalence-group cursor; _crit/_prevmax/_iter are not copied
|
| virtual bool | optimize_within_margin (const RETURNTYPE margin, RETURNTYPE &result1, RETURNTYPE &result2, PSubset &sub, const PCriterion crit) |
| | Re-ranks the tracked results within margin of the best tracked (primary) value by a secondary crit, returning the one crit ranks highest.
|
| virtual bool | optimize_within_first_equivalence_group (RETURNTYPE &result1, RETURNTYPE &result2, PSubset &sub, const PCriterion crit) |
| | Starts a group-by-group scan: returns the subset of the first equivalence group (the tracked subsets sharing the highest primary criterion value) that crit ranks highest.
|
| virtual bool | optimize_within_next_equivalence_group (RETURNTYPE &result1, RETURNTYPE &result2, PSubset &sub) |
| | Continues the scan started by optimize_within_first_equivalence_group(): returns the best subset of the next equivalence group (the next lower primary criterion value), ranked by the criterion given there.
|
| virtual std::ostream & | print (std::ostream &os) const override |
| | writes a human-readable identification of the object; base default writes nothing
|
| Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > * | clone () const override |
| | dispatches to the DEEP_KIND mechanism (default CLONE_DEEP: Derived's copy-constructor)
|
| Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > * | sharing_clone () const override |
| | dispatches to the SHARING_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention)
|
| Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > * | stateless_clone () const override |
| | dispatches to the STATELESS_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention)
|
| | Result_Tracker_Dupless (const IDXTYPE capacity_limit=0) |
|
| Result_Tracker_Dupless (const Result_Tracker_Dupless &rtd) |
| | copies the configuration (margin, cardinality restriction, capacity limit) only; the results list is NOT copied (starts empty) – this constructor backs stateless_clone() (CLONE_DEEP), which by contract does not replicate exact object state
|
| virtual bool | add (const RETURNTYPE value, const PSubset sub) override |
| | Offers one (value, subset) result for inclusion; sub is copied, the caller keeps ownership of its own object.
|
| virtual void | clear () override |
| | discards all recorded results
|
| virtual std::size_t | size () const override |
| | 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 std::size_t | size (const RETURNTYPE margin) const |
| | number of currently held results whose value is within margin of the best (first, highest-value) held result
|
| virtual bool | get_first (PResultRec &r) override |
| | starts iteration at the best held result; false if nothing is held. The returned pointer refers into this tracker's own storage and is invalidated by add(), join() and clear()
|
| virtual bool | get_next (PResultRec &r) override |
| | hands out the next result in descending-value order; false when the iteration is exhausted. There is one shared cursor per tracker, so nested or concurrent iterations of the same tracker interfere
|
| virtual void | join (Result_Tracker< RETURNTYPE, SUBSET > &src) override |
| | merges the results held by src into this tracker, keeping the ordering and skipping duplicates exactly as add() does, then re-applies the capacity limit and the margin to the merged list. Consumes src's iteration cursor; src itself is left unchanged
|
|
void | set_inclusion_margin (const RETURNTYPE margin=0) |
| | restrict adding to only subsets with criterion value within given distance (margin) from best known
|
|
void | set_inclusion_cardinality_restriction (const DIMTYPE d) |
| | for d>0 restricts adding only to subsets of size d, for d=0 subset size restriction is removed
|
|
RESULTSITER | begin () |
| | iterator to the best (first) held result
|
|
RESULTSITER | end () |
| | iterator past the last held result
|
|
| Result_Tracker (const Result_Tracker &rt) |
| | copies the output-detail setting only – concrete trackers copy their own collected results separately
|
| Result_Tracker * | clone () const override |
| Result_Tracker * | sharing_clone () const override |
|
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
|
| 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
|
template<class RETURNTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
class FST::Result_Tracker_Regularizer< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET, CRITERION >
Collects multiple results. Enables eventual selection of alternative solution based on secondary criterion.
Enables selecting a different subset than the one yielded by the search procedure, e.g., with the aim to reduce overfitting or to take into account known feature acquisition cost.
The idea is to consider all known subsets with criterion value close enough to the maximum as effectively equal - then another criterion is used to choose among those alternative solutions. This technique can improve generalization/robustness and reduce overfitting, as well as open up other possibilities, like preferring a subset being almost equal to the primarily selected, but with considerably lower feature value acquisition cost, etc. For details see paper "Somol, Grim, Pudil: The Problem of Fragile Feature Subset Preference in Feature Selection Methods
and A Proposal of Algorithmic Workaround. In Proc. ICPR 2010. IEEE Computer
Society, 2010".
- Examples
- demo52t.cpp.