Skip to content

Using featsel main program

Marcelo S. Reis edited this page Jul 2, 2019 · 6 revisions

To run the featsel main program, after a successful compilation just type:

> bin/featsel

inside the main directory. For the proper use of the parameters, type bin/featsel -h or look at featsel paper describing this framework.

In the following, we provide two syntax examples, one using a XML file and another with a DAT one. For a description of those two formats, refer to Section 8.

Example using a XML file

In this example, featsel main program is executed on a XML file containing a subset sum instance of seven elements, using the SFS algorithm (code sfs), the subset sum cost function (code subset_sum) and showing the best four results:

> bin/featsel -f input/subset_sum/Test_07_A.xml -c subset_sum -a sfs -m 4  

The output of this call should be like this one:

== List of best subsets found ==
 X : c(X)
 <0101111> : 0
 <0001111> : 2
 <0000111> : 6
 <0000011> : 11

Number of visited subsets: 28
Required time to compute the visited subsets: 1770 microseconds 
(average 63 microseconds per node)

Elapsed time of execution of the algorithm (in microseconds): 2074

== End of processing ==

The first column is a subset X of the set S of elements, in the format [b_1, ..., b_|S|], where the bit b_i is "1" is it belongs to X and "0" otherwise, and the second column is the cost of X, that is, the value of c(X).

Example using a DAT file

In this example, we execute featsel over the Iris dataset, which consists in a set of samples with 4 features and 3 labels. Opposite to a XML file, when we use a DAT file we must specify the number of features (using the argument -n) and the number of labels (argument -l). Therefore, to run featsel on that dataset using an exhaustive search (code es) and the mean conditional entropy (code mce) as the cost function, one might type:

> bin/featsel -c mce -a es -l 3 -n 4 -f input/Iris/Test_01_A.dat 

which yields an output like this:

== List of best subsets found ==
 X : c(X)
 <0111> : 0.12579749524593353

Number of visited subsets: 16
Required time to compute the visited subsets: 5560 microseconds 
(average 347 microseconds per node)

Elapsed time of execution of the algorithm (in microseconds): 5585

== End of processing ==

Observe that just one subset was showed, since the default number of best subsets is one. If the user wants to increase that number, he/she must use the -m argument (in the XML example above, four best subsets was shown due to the usage of -m 4).

Clone this wiki locally