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 tutorial3. This example file gather all the settings for a 'multiple' polynomial regression. We want to evolve a system of ordered polynomial equations by using the mathematical operators: '+','*' and the ADF: ADF1 and ADF2, in the said order. an ADF2 branch could then call for an ADF1 terminal, but not the opposite. We try to find the following model being shaped as a system of polynomials:
|ADF1=x+y
|ADF2=ADF1^3
from 30 sets of testing data (30 different values for x and y). This means the each tree has to be evaluated for every different example, so 30 times. There is an alternative solution which we will see in the next tutorial, where instead of evaluating a tree 30 times, we will input an array of 30 data in the variable leafs of the tree. Considering the constraints for building the trees, the root node will have 2 children ADF1 and ADF2 (in order), and ADF2 must be able to reuse ADF1 as a terminal... A typical way to run the tutorial would be to:
>>> # setup for running tutorial 3 functions = tutorial3.functions crossover_mapping=tutorial3.crossover_mapping nb_eval=tutorial3.nb_eval ideal_results=tutorial3.GetIdealResultsData() terminals =tutorial3.terminals Strongly_Typed_Crossover_degree=tutorial3.Strongly_Typed_Crossover_degree Substitute_Mutation=tutorial3.Substitute_Mutation treeRules = tutorial3.treeRules adfOrdered = tutorial3.adfOrdered FitnessFunction = tutorial3.FitnessFunction
>>> import evolver if __name__ == "__main__": >>> dbname=r'C:\pop_db' >>> evolver.EvolutionRun(2000,(0,2,'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, '*': multiply, 'adf2_+': add, 'adf2_*':
|
|||
crossover_mapping =
|
|||
nb_eval = 30
|
|||
all_x =
|
|||
all_y =
|
|||
ideal_results =
|
|||
terminals =
|
|||
defaultFunctionSet =
|
|||
defaultTerminalSet =
|
|||
Adf2DefaultFunctionSet =
|
|||
Adf2DefaultTerminalSet =
|
|||
treeRules =
|
|||
Strongly_Typed_Crossover_degree = 1
|
|||
Substitute_Mutation = 0
|
|||
adfOrdered = True
|
|||
__package__ = None
|
|||
i = 29
|
|
functions
|
crossover_mapping
|
all_x
|
all_y
|
terminals
|
Adf2DefaultTerminalSet
|
treeRules
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 15 11:50:09 2009 | http://epydoc.sourceforge.net |