How to use Genetic Programming Toolbox in MATLAB

11 ビュー (過去 30 日間)
Benjamin
Benjamin 2020 年 1 月 15 日
回答済み: Blake Van Winkle 2020 年 1 月 22 日
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

回答 (2 件)

Blake Van Winkle
Blake Van Winkle 2020 年 1 月 15 日
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 件のコメント
Benjamin
Benjamin 2020 年 1 月 15 日
Thank you Blake for your response.
I was able to implement the GP method to my own database. I am just wondering now how I can add more symbol functions such as exp, ln, sqrt as it is NOT as simply as adding 'exp' to 'symbols{1}'?
Blake Van Winkle
Blake Van Winkle 2020 年 1 月 15 日
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
Blake Van Winkle 2020 年 1 月 22 日
Here is an alternative that looks to be a little more exhaustive.
http://gplab.sourceforge.net/download.html

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by