Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::SubSetSelector Class Reference

#include <FeatureSelector.h>

Inheritance diagram for prapi::SubSetSelector:

Object EventSource< SelectionEvent > Object prapi::BeamSelector prapi::SequentialSelector List of all members.

Detailed Description

A common base class for methods searching for sub-optimal subsets (of features, for example).

Public Methods

 SubSetSelector (GoodnessMeasure &measure)
 Create a new SubSetSelector with the given goodness measure.

virtual util::List< int > optimize (int totalCount, int desiredCount=-1)=0
 Find a sub-optimal subset of items.

void stop ()
 Stop the optimization.

double measureGoodness (const util::List< int > &enabledIndices)
 Measure the goodness of a subset (of features).

void setGoodnessThreshold (double threshold)
 Set the goodness value after which optimization is stopped.

double getGoodnessThreshold () const
 Get the goodness value after which optimization is stopped.

Protected Attributes

bool _bStopped
 A flag indicating whether the optimization should be continued.

 The goodness measure.

double _dGoodnessThreshold
 The goodness threshold.

Constructor & Destructor Documentation

prapi::SubSetSelector::SubSetSelector GoodnessMeasure   measure [inline]

Create a new SubSetSelector with the given goodness measure.

The goodness measure is consulted whenever a set of features needs to be evaluated.

Member Function Documentation

double prapi::SubSetSelector::measureGoodness const util::List< int > &    enabledIndices

Measure the goodness of a subset (of features).

This methods consults the internal goodness measure to perform the actual measurement.

virtual util::List<int> prapi::SubSetSelector::optimize int    totalCount,
int    desiredCount = -1
[pure virtual]

Find a sub-optimal subset of items.

The implementation of this method is method-dependent. By convention, each implementation should fire a SelectionEvent every time an optimization round is finished.

totalCount  the total number of items out of which the subset is to be selected.
the  desired number of enabled items after optimization. If this value is set to a non-positive value, optimization is stopped only after the goodness threshold is exceeded.

Implemented in prapi::SequentialSelector, and prapi::BeamSelector.

void prapi::SubSetSelector::setGoodnessThreshold double    threshold [inline]

Set the goodness value after which optimization is stopped.

To disable the threshold, set it to a non-positive number.

void prapi::SubSetSelector::stop   [inline]

Stop the optimization.

This method is useful with fancy stopping criteria. If the optimization is not to be stopped after a certain number of iterations but according to some other rule, this method can be called from the measureGoodness() method of the GoodnessMeasure. This method sets the _bStopped flag to true.

The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.