Trees | Indices | Help |
|
---|
|
Contains all parameters for the evolutionary run, grammar rules, constraints, and specifics about the terminal and function set of the trees in tutorial2. This example file gather all the settings for a simple polynomial regression using this time 2 variables x and y, and adding random integer constants between 1 and 5, and the following mathematical operators: '+','-','neg','*','^2'(or square). We try to find the following polynomial: x^2+3y+4 from 5 sets of testing data (5 different values for x and y). As Koza said, random constants are the "skeleton in Genetic Programming closet". Using them will definitely slow down a search... Any suggestions of current alternative strategies solving this problem would be highly welcomed :) Considering the constraints for building the trees, the root node will only have one child, and there will be no need for ADF in the function and terminal set. A typical way to run the tutorial would be to:
>>> #setup for running tutorial 2 functions = tutorial2.functions crossover_mapping=tutorial2.crossover_mapping nb_eval=tutorial2.nb_eval ideal_results=tutorial2.GetIdealResultsData() terminals =tutorial2.terminals Strongly_Typed_Crossover_degree=tutorial2.Strongly_Typed_Crossover_degree Substitute_Mutation=tutorial2.Substitute_Mutation treeRules = tutorial2.treeRules adfOrdered = tutorial2.adfOrdered FitnessFunction = tutorial2.FitnessFunction
>>> import evolver if __name__ == "__main__": >>> dbname=r'C:\pop_db' >>> evolver.EvolutionRun(2000,(0,1,'root'),2,8,'AddHalfNode',100, 0.00001 ,0.5,0.49,7,0.8,dbname,True)
This means that we define:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author: by Mehdi Khoury
Version: 1.20
Copyright: (c) 2009 Mehdi Khoury under the mit license http://www.opensource.org/licenses/mit-license.html
Contact: mehdi.khoury at gmail.com
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
functions = {'+': add, '-': sub, 'neg': neg, '*': multiply, '^
|
|||
nb_eval = 5
|
|||
all_x =
|
|||
all_y =
|
|||
ideal_results =
|
|||
terminals =
|
|||
set_ERC =
|
|||
crossover_mapping =
|
|||
defaultFunctionSet =
|
|||
defaultTerminalSet =
|
|||
treeRules =
|
|||
Strongly_Typed_Crossover_degree = 0
|
|||
Substitute_Mutation = 0
|
|||
adfOrdered = False
|
|||
__package__ = None
|
|||
i = 4
|
|
functions
|
all_x
|
all_y
|
terminals
|
set_ERC
|
defaultFunctionSet
|
defaultTerminalSet
|
treeRules
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 15 11:50:09 2009 | http://epydoc.sourceforge.net |