How to use Genetic Programming Toolbox in MATLAB
11 views (last 30 days)
Show older comments
Hello
Dear all
I am working on developing a relationship on some input parameters (X1, ... , Xn) and an output parameter (Y). As it is unknown what kind of relationship my X's essentianlly have with each other, I started to use the Genetic Programming toolbox in MATLAB as it seems a good method for such purpose.
I read this overview and I got an idea how it is working, but there are some values assinged to some parameters in those functions that I don't know why, and if I need to change those based on my own needs!!! I am refering to:
- popsize = 40
- maxtreedepth = 5
- opt (! why it's size is 10)
- c = 2:20
I couldn't find more information on that, so I do appreciate if someone clarifies those paramters for me
0 Comments
Answers (2)
Blake Van Winkle
on 15 Jan 2020
Ok Ben, this is Blake again. I will try to help out as much as I can.
First, I have never used their code, but I have forced others to use GP codes in the past.
The population size is referenced to the amount of participants that the optimizer has to work with. Being that this is more or less a genetic algorithm, it works off of using the cost of each participant to define how useful the individual is. Individuals that are poor are usually discarded (die) and useful individuals are usually allowed to breed to produce new solutions as well as survive more than one generation (sort of like Methuselah). Anyhow, there isn't really a good rule of thumb that is followed on the size of the population, but I did see years ago a reference to 20 to 40 times the dimensions of the problem. This could be taken as N*n_actual or N*n_bin. I use this as N*n_actual because I don't have infinite computing resources. (n_actual = number of indepenent variables, n_bin = binary conversion of the values that the GP manipulates)
"maxtreedepth = 5" looks to be the how many times you want to check out the different options per variable. If you only have x & y as variables and you had tree depth as "2", it may result in the option of having x^2, x*y, y^2, x, y, 1 as the max number of independent variable relations. "3" would give you this: x^3, x^2*y, x*y^2,y^3, x^2, x*y, y^2, x, y, 1. And so on... NOTE: that is just conjecture on my part. I would suggest dabbling with that number and see what happens.
This is from the notes within one of the files: (aka: heck if I know)
opt -> evaluation parameters (set empty for default)
[opt(1) opt(2)]: a1, a2 tree-size penalty parameters (default: 0,0)
opt(3): OLS treshold value, range: 0-1 (default: 0)
opt(4): if == 1 then polynomial evaluation else normal (default: 0)
c is just this person's definer for iterations. One could probably get fancy and find a way that is doesn't change much after a call and end it there, but if you have the compute, just run a few cases.
Good Luck,
Blake
2 Comments
Blake Van Winkle
on 15 Jan 2020
To Ben:
I would suggest using a symbolic solver to extract out those values. In a sense, you will have those with the format it has because "exp" and "ln" have taylor series alternatives.
Blake
Blake Van Winkle
on 22 Jan 2020
Here is an alternative that looks to be a little more exhaustive.
http://gplab.sourceforge.net/download.html
0 Comments
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!