LAGEP: An open-sourced genetic programming tool
LAGEP, Layered Architecture GEnetic Programming,
is an open-sourced genetic programming tool which implements genetic programming
for function generating. The LAGEP project is aimed to provide a friendly tool for developers/users who want to use GP.
Source codes of LAGEP are available under GPL license.
LAGEP is not only capable of running layered architecture GP [Lin 2007] but also standard single population GP.
Users who may not need GP-related background can easily apply LAGEP or revise codes for their problems. Currently, LAGEP
is designed as a classifier.
Many techniques including code optimization and algorithm optimization are used in LAGEP, for
example, the random numbers are generated by Agnor's RNG [Agnor 2007].
Any suggestion about the LAGEP is welcomed. Moreover, any suggestion about program coding is also appreciated.
Please sent me feedback after you use LAGEP, thank you!
- [Lin 2007] J. Y. Lin, H. R. Ke, B. C. Chien, W. P. Yang, Designing a Classifier by a Layered Multi-Population Genetic Programming Approach, Pattern Recognition, Vol. 40, Issue 8, Aug. 2007, pp. 2211-2225
- [Lin 2008] J. Y. Lin, H. R. Ke, B. C. Chien, W. P. Yang, Classifier Design with Feature Selection and Feature Extraction Using Layered Genetic Programming, Expert Systems with Applications, supposed to be appear at 35(2), 2008.
- [Agnor 2007] Agnor Fog, Pseudo random number generator - uniform and non-uniform distributions, http://www.agner.org/random/
If you use LAGEP in your work, please cite [Lin 2007].
Characteristics of LAGEP
- Platform: 32bit Windows
- Program language: C/C++
- Windows API used: No
- User interface: console mode
- Linear function: supported
- Non-linear operators: supported (division, multiply, sine, cosine, natural log, exponential)
- Validation process: supported (A function evaluaing "score" is used to determine which individual is the best [Lin 2007])
- Configuration: XML and INI formats (using TinyXML)
- XML file output: supported
- Instances can be stored in either row order or column order.
- Preparing data format of instances in the same way to SVMlight.
- OpenMP is used.
- Documented by Doxygen (not fully completed...)
- Individuals are represented by binary trees.
- Four basic binary arithmatic operators +, -, *, / (protected division)
- Use weight to disable unwanted operators, for example, user can turn off operators sin and cos by giving them a zero weight.
- The percentage of using grow method in population initialization is adjustable
- Determinant tournament selection method is used.
- A method to tune mutation rate named AMRT is used [Lin 2007]
- Constants can be real numbers.
- Support user-defined constants, e.g. PI and e. (define them at constants.ini)
- Function simplification process
- Graph representation
v0.81 -> v0.811
- To avoid NaN error, any x in ln(x) is transformed by the abs function to be positive.
- Added one more function: Exp function.
v0.811 -> v0.812
- Re-organize files.
- Fix problems of the growing method.
- Fix the problem of dataAlignment. (2008/04/14)
- Fitness functions is selectable. Use "-fn X" to choose between accuracy, precison, recall, F-Measure and specificity.
- Fix a problem of calculating true-positive, true-negative, false-positive, and false-negative. (2008/04/18)
v0.812 -> v0.82
- documentation (by doxygen)
- configuration file can be orgazined in XML format
- A new tree evaluation function is used to improve efficiency
- Configuration will be shown on screen at first stage, this could be easier for user to identify whether the configuration has mistakes or not.
- fix other bugs.
v0.82 -> v0.83
- Add allowSelfCrossover option.
- LGP Config Maker now can generate configuration file in both ini and xml formats.
- Code quality is improved a little bit...
How to customize LAGEP for your purpose?
- Modify io.h and io.cpp to fit the data format.
- Modify fitnessFunc.cpp to add new fitness functions.
Current version: 0.83
Download 0.83 with installer(ZIP format, including source codes)
Download 0.83 with installer(RAR format, including source codes)
0.82 release 0615
Download 0.82 with installer(ZIP format, including source codes)
0.812 release 0418
Download 0.812 with installer(ZIP format, including source codes)
How to use
The execution file is lgp.exe
is called by
lgp.exe -t training_file -p test_file -v validation_file -c target_class -i configuration.ini -j job_name [optional]
-t : following the training set file name
-c : following the target class symbol
-p : following the test set file name
-v : following the validation set file name
-i : following the configuration INI file name
-j : following the job name, use job name to distinct different runs
-silence : do not display any information on console
-linear : generate only linear discriminant functions
-xml : output in XML format. (Not available if -silence used)
-showTest : show test accuracy of the best individual every generation
-fn : select a fitness function. fn 1 -> accuracy(default), fn 2 -> precision, fn 3 -> recall, fn 4 -> F-measure, fn 5 -> Specificity.
lgp -t TRAIN.txt -p TEST.txt -c 1 -j 20070101
lgp -t TRAIN.txt -p TEST.txt -c 1 -i multilayer.ini -j 20070101 -fn 2
- If the configuration file is not specified, default values are used.
- We strongly recommand users to have a proper job name. However, this argument is optional
Instances should be represented as following format:
target field could be a string, but an integer if prefered.
1 1:12.3 2:32.5 3:44.3 #this is an example instance having three features belonging to class 1
2 1:12.5 2:33.3 3:64.3
1 1:22.3 2:12.3 3:82.6
feature field begins at 1.
Any line begins with a "#" is a comment and will be ignored.
Users can find an executable file "FileChecker" from the download file.
FileChecker checks correctness of the input files.
There are many settings available in LAGEP. User can read the exampleINI.ini to
know what setting is needed.
Disclaimer and copyright
This software is free only for non-commercial use. It must not be distributed without prior permission of the author. The author is not responsible for implications from the use of this software.
Copyright (c) 2005 Jung-Yi Lin All rights reserved. Redistribution and use in
source and binary forms, with or without modification, are permitted provided
that the following conditions are met: 1. Redistributions of source code must
retain the above copyright notice, this list of conditions and the following
disclaimer. 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. 3. Neither
name of copyright holders nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.