Example 11t: Threaded wrapper-based feature selection with Floating Search. More...
#include <boost/smart_ptr.hpp>
#include <exception>
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include "error.hpp"
#include "global.hpp"
#include "subset.hpp"
#include "data_intervaller.hpp"
#include "data_splitter.hpp"
#include "data_splitter_5050.hpp"
#include "data_splitter_cv.hpp"
#include "data_scaler.hpp"
#include "data_scaler_void.hpp"
#include "data_accessor_splitting_memTRN.hpp"
#include "data_accessor_splitting_memARFF.hpp"
#include "criterion_wrapper.hpp"
#include "distance_euclid.hpp"
#include "classifier_knn.hpp"
#include "seq_step_straight_threaded.hpp"
#include "search_seq_sffs.hpp"
Functions | |
int | main () |
Example 11t: Threaded wrapper-based feature selection with Floating Search.
int main | ( | ) |
As alternative to standard sequential evaluation of feature subset candidates FST3 enables threaded candidate subset evaluation. All FST3 sequential search methods can be easily parallelized by using Sequential_Step_Straight_Threaded
instead of Sequential_Step_Straight
evaluator object. The actual search speed gain depends on particular problem setting. In small-sample, low-dimensional settings, or when criterion evaluation is very fast, the actual gain can remain negligible or even negative due to thread management overhead (note that this also considerably depends on compiler). This example is the threaded version of Example 11: Wrapper-based feature selection with Floating Search. with the 15-dimensional (i.e., low-dimensional) small-sample speech dataset. It illustrates well the threading performance issue. When compiled under cygwin with gcc 4.3.x and Boost 1.33.1 it operates slower than the equivalent sequential code in Example 11: Wrapper-based feature selection with Floating Search.. In contrary, when compiled under Visual C++ 2010 with Boost 1.44, it operates faster.
References FST::Search_SFFS< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR >::get_result(), FST::Search_SFFS< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR >::search(), and FST::Search_SFFS< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR >::set_search_direction().