Running Genetic Programming (GP)
This guide explains how to use EvOC to set up and run Genetic Programming (GP) experiments.
What is Genetic Programming (GP)?
Genetic Programming (GP) is a specialized type of evolutionary algorithm where the individuals in the population are computer programs (represented as trees) rather than fixed-length strings or lists. EvOC allows you to evolve these programs automatically to solve problems like symbolic regression, based on the configurations you provide through the GUI.
Configuring and Running GP
Follow these steps to build and execute your GP algorithm:
Select Algorithm Type:
- From the main EvOC Dashboard, click on the
Genetic Programming (GP)
option.
- From the main EvOC Dashboard, click on the
Configure GP Parameters:
- GP configuration involves defining the building blocks (functions and terminals) and constraints for the program trees. Work through the UI options, paying attention to GP-specific settings like:
- Algorithm Strategy (e.g.,
eaSimple
applied to trees) - Primitive Set: Defining the functions (e.g.,
add
,sub
,mul
,sin
) and terminals (e.g., input variables, ephemeral constants) the evolved programs can use. - Tree Generation: Methods like
genFull
,genGrow
, orgenHalfAndHalf
. - Tree Constraints: Setting minimum and maximum tree height/depth.
- Evaluation Function: Defining how the fitness of an evolved program is measured (e.g., error on a symbolic regression task).
- Standard EA parameters like Population Size, Generations, Crossover, Mutation (specific tree-based operators), and Selection.
- Algorithm Strategy (e.g.,
Configuration Details
Refer to the tooltips within the EvOC interface for explanations of each specific GP parameter and operator. A detailed walkthrough video or screenshots may be added here in the future.
- GP configuration involves defining the building blocks (functions and terminals) and constraints for the program trees. Work through the UI options, paying attention to GP-specific settings like:
Execute the Algorithm:
- Once your GP configuration is complete, click the
Execute Algorithm
button at the bottom of the configuration screen.
- Once your GP configuration is complete, click the
Understanding and Using Your GP Results
After the execution finishes, the results interface will display information specific to your GP run:
Best Individual Program & Fitness
EvOC will show the Best Individual Fitness achieved.
Crucially for GP, it will display a visualization of the Best Individual Program found, typically as a tree structure representing the evolved program or function. Analyze this tree to understand the solution EvOC discovered.
Sharing Your Run
Click
Share Run
to share this GP experiment (configuration and results) with other registered EvOC users.Enter their email addresses (comma-separated for multiple users) in the pop-up window.
Viewing and Downloading Logs
Click
Show Logs
to view detailed generation-wise statistics (fitness values, tree sizes, etc.).Click the
Download Logs
button within this view to save the log data (.txt
) for detailed analysis.
Viewing the Generated Code
Click
Show Code
to see the underlying DEAP Python code corresponding to your GP configuration.Use the
Ask EvOC AI to Explain
feature if you need help understanding parts of the code or GP concepts.
Accessing Run History
- Find your complete history of experiments, including this GP run, via the
View Previous Runs
orView All Runs
button/link, usually accessible from the dashboard or algorithm selection areas.
Next Steps:
- Learn about Running a Traditional EA.
- Explore configuring Particle Swarm Optimization (PSO).
- See how to use EA for ML Tuning.