-
Notifications
You must be signed in to change notification settings - Fork 3
Adding and removing algorithms and cost functions
Codes and class names of the available algorithms and cost functions are stored in the flat files ListOfAlgorithms.txt and ListOfCostFunctions.txt, respectively. However, manual edition of those files is not recommended; if the user wants to add or remove an algorithm and/or a cost function, he/she must proceed as explained in the following.
To include a new algorithm, type:
> perl bin/add_new_algorithm.pl code ClassName
Where:
-
code: a code for the algorithm, which will be employed as an argument in the featsel main program in order to use this algorithm. -
ClassName: name of the algorithm class.
If the user try to add an algorithm whose name is already used by either another algorithm, a cost function, or other main program class and/or file, the "add_new_algorithm.pl" program will return an error message.
If the user successfully includes a new algorithm, say X, then the following files will be created:
|---\src\
| |---\algorithms\
| |---\X.cpp
| |---\X.h
|
|---\test\
| |---\algorithms\
| |---\XTest.cpp
| |---\XTest.h
Besides, the "Makefile", "featsel.cpp", and "featselTest.cpp" will be properly updated. The user must just edit the files in the directory tree above and run "make" and "make test" in order to have her/his new algorithm functionally available.
To include a new cost function, type:
> perl bin/add_new_cost_function.pl code ClassName file_type
Where:
-
code: a code for the cost function, which will be employed as an argument in the featsel main program in order to use this cost function. -
ClassName: name of the cost function class. -
file_type: may be either "dat" (flat file) or "xml".
If the user tries to add a cost function whose name is already used by either another cost function, an algorithm or other main program class and/or file, the "add_new_cost_function.pl" program will return an error message. On the other hand, if the user successfully includes a new cost function, say Y, then the following files will be created:
|---\lib\
| |---\Y.m
|
|---\src\
| |---\functions\
| |---\Y.cpp
| |---\Y.h
|
|---\test\
| |---\functions\
| |---\YTest.cpp
| |---\YTest.h
Besides, the "Makefile", "featsel.cpp", and "featselTest.cpp" will be properly updated. The user must just edit the files in the directory tree above and run "make" and "make test" in order to have her/his new cost function functionally available.
It is noteworthy to remark that once a new cost function is included, then it can be used straightforwardly in the benchmarking program if the user put manually them into the "/input/tmp" directory. However, to generate random instances of the newly included cost function, the user must edit a subroutine to this end within the file "/lib/Y.m"; the subroutine itself will be named as "sub random_y_instance", where "y" is the code of the cost function Y.
To remove an algorithm, type:
> perl bin/remove_algorithm.pl code ClassName
Where:
-
code: the algorithm code. -
ClassName: name of the algorithm class.
To remove a cost function, type:
> perl bin/remove_cost_function.pl code ClassName
Where:
-
code: the cost function code. -
ClassName: name of the cost function class.