Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## gplab-users

 [gplab-users] Tree complexity configuration From: N.Y. - 2009-07-12 15:51:20 Attachments: Message as HTML ```Hi   I am running a simple symbolic regression problem in GPLAB.   I have two problems:   1)The above setting means that I have the {'strictdepth'} filter on, which should reject an individual deeper than the maximum allowed depth, which is determined by the parameter realmaxlevel and equals 17 (for depthnodes='1').   2)I want to access tree specifications such as number of nodes and max level in regfitness.m   my settin gs are as follow: p=resetparams; p=setoperators(p,'crossover',2,2,'mutation',1,1); p.operatorprobstype='variable'; p.minprob=0.1; p=setfunctions(p,'plus',2,'minus',2,'times',2,'mydivide',2,'cos',1,'sin',1); p.calcfitness='regfitness_mse'; p.datafilex='TrainNormIn.txt';%'Zavie_Rc_SigmaC.txt'; p.datafiley='TrainNormOut.txt';%'S.txt'; p.operatorprobstype='variable'; p.fixedlevel=1; p.realmaxlevel='5'; %17 if depthnodes=1, 512 if depthnodes=0 p.depthnodes='1';  %1=depth, 2=size p.dynamiclevel='0'; p.strictnodes='5'; p.strictdepth='5'; p.savetofile='every100'; p.savedir='SavedFiles'; p.calcdiversity={'uniquegen'}; p.calccomplexity=1; p.graphics={'plotfitness','plotdiversity','plotcomplexity','plotoperators'}; p.reproduction=0.1;       ```
 Re: [gplab-users] Tree complexity configuration From: Sara Silva - 2009-07-15 15:09:08 ``` N.Y. wrote: > Hi Hello, stranger (whatever your name is) :) > 1)The above setting means that I have the {'strictdepth'} filter on, > which should reject an individual deeper than the maximum allowed depth, > which is determined by the parameter realmaxlevel and equals 17 (for > depthnodes='1'). Actually, these settings are not correct. > p.realmaxlevel='5'; %17 if depthnodes=1, 512 if depthnodes=0 Please remove the quotes (write only 5, not '5'). This should guarantee that no tree will ever be deeper than 5. > p.strictnodes='5'; > > p.strictdepth='5'; These are names of filters. The p.filters parameter is set automatically with all the needed filters. You should not set it manually, and anyway this would not be the way to do it, so these lines should be removed. > p.calccomplexity=1; Just a warning: This is correct, but be aware that it's computationally expensive. > 2)I want to access tree specifications such as number of nodes and max > level in regfitness.m regfitness.m has the individual ('ind') and the run parameters ('params') as input arguments, so you are able to access this information. If you need other things, like state variables, you can try to add the 'state' variable as an input argument to regfitness.m. It is available in the function that calls regfitness (calcfitness.m), so it should not be difficult. I hope this helps. Best luck! Sara ```