Genetic programming: a symbolic regression problem

From JCLEC wiki
Jump to: navigation, search

The goal of symbolic regression is to obtain a symbolic expression that represents a mathematical function. In particular, this example approximates the function: <math>f(x) = x^4 + x^3 + x^2 + x</math>.

<math>f(x) = x^4 + x^3 + x^2 + x</math>
<math>x=-2</math> <math>f(x) = 10</math>
<math>x=-1</math> <math>f(x) = 0</math>
<math>x=0</math> <math>f(x) = 0</math>
<math>x=1</math> <math>f(x) = 4</math>
<math>x=2</math> <math>f(x) = 30</math>

Example

Download and run the symbolic regression problem

java -jar jclec4-tutorial.jar SymReg.cfg

Output

Generation 50 Report

Best individual: net.sf.jclec.exprtree.ExprTreeIndividual[genotype=(+ + - + X + X X + X X - X - + X X X + * X X * X + X X),fitness=net.sf.jclec.fitness.SimpleValueFitness@26ae533a[value=0.0]]
Worst individual: net.sf.jclec.exprtree.ExprTreeIndividual[genotype=(+ + - + X + X X + X X - X - + X X X + * X X X),fitness=net.sf.jclec.fitness.SimpleValueFitness@474b5f4a[value=10.0]]
Median individual: net.sf.jclec.exprtree.ExprTreeIndividual[genotype=(+ + - + X + X X + X X - X - + X X X + * X X * X + X X),fitness=net.sf.jclec.fitness.SimpleValueFitness@6c69d02b[value=0.0]]

Average fitness = 0.28
Fitness variance = 2.0816

The best individual achieved the optimal solution and found the expression <math>f(x) = x^4 + x^3 + x^2 + x</math>.

For further information see the symbolic regression Wiki