« Experimenting with Eureqa's API | Main | Symbolic Regression with JGAP - some improvements »

Experimenting with Eureqa's API II: eureca_cli

In Experimenting with Eureqa's API, I mentioned a simple C++ program using Eureqa's API. Now I have written a program with more command line options and flexibility: eureqa_cli.cpp. It is also available from my Eureqa page.

eureqa_cli

Running the program eureqa_cli without any arguments shows the valid options:


Syntax:
     eureca_cli datafile relationship functions fitness_method population_size crossover_prob mutation_prob
where only the data file and relationship must be stated.

...

It then lists all the valid options for functions and fitness methods, see below under Full help notice. Also see Eureqa's API for more information about Eureqa's options. I have not added any function of my own (because this is not possible at the moment) and so use what is available in Eureqa.

Default values

The default values of eureqa_cli are:
  • functions (building blocks): "a a+b a-b a*b a/b"
  • fitness: "absolute_error
  • population_size: 100
  • crossover_probability = 0.5
  • mutation_probability = 0.01

The following parameters are set as the default values from Eureqa, but are not options to the program:

  • normalize_fitness_by_ = 10.0;
  • predictor_population_size_ = 10;
  • trainer_population_size_ = 10;
  • predictor_crossover_probability_ = 0.5;
  • predictor_mutation_probability_ = 0.2;
  • implicit_derivative_dependencies_ = "";

Examples

Here are some examples using the program. The data files is at my Eureqa page.
  • eureqa_cli number_puzzle1.txt "z = f(x,y)"
  • eureqa_cli fib_38_ix.txt "t1 = f(ix)" "a a+b a-b a*b a/b a^b sqrt(a)"
  • eureqa_cli boyles_law.txt "PV = f(P,V)"
  • eureqa_cli p4_1.txt "y = f(x)" "a a+b a-b a*b a/b" "absolute_error"
  • eureqa_cli two_spirals.txt "z = f(x,y)" "a a+b a-b a*b a/b sin(a) cos(a) exp(a) log(a)"
  • eureqa_cli fib_38_ix.txt "t1 = f(ix)" "a a+b a-b a*b a/b a^b sqrt(a)" "squared_error" 1000 0.9 0.10 (with populations size 1000, crossover probability 0.9, and mutation probability 0.10)

See Experimenting with Eureqa's API for output of similar problems.

Eureqa server

This program requires that the Eureqa server (the program eureqa_server) has been started. See Experimenting with Eureqa's API for some more about this.

Full help notice

Here is the full help notice of the program:


eureqa_cli is a command line interface to Eureqa's eureqa_server
Syntax:
    eureca_cli datafile relationship functions fitness_method population_size crossover_prob mutation_prob
where only the data file and relationship must be stated

Valid functions (building blocks):
* constant: 1.34
* data variable: x
* addition: x+y
* subtraction: x-y
* multiplication: x*y
* division: x/y
* power: x^y
* exponential: exp(x)
* logarithm: log(x)
* sine: sin(x)
* cosine: cos(x)
* absolute value: abs(x)
* tangent: tan(x)
* two-input arctangent: atan2(x,y)
* minimum of two: min(x,y)
* maximum of two: max(x,y)
* square root: sqrt(x)
* gamma function: gamma(x)
* gaussian function: gauss(x)
* logistic function: logistic(x)
* hill function, power 2: hill2(x)
* step function: step(x)
* sign function: sign(x)
* arcsine: asin(x)
* arccosine: acos(x)
* arctangent: atan(x)
* hyperbolic sine: sinh(x)
* hyperbolic cosine: cosh(x)
* hyperbolic tangent: tanh(x)
* inverse hyperbolic sine: asinh(x)
* inverse hyperbolic cosine: acosh(x)
* inverse hyperbolic tangent: atanh(x)Special building blocks:
* equals: y = f(x)
* search formula: y = f(x)
* derivative: D(y,t) = f(x,y)

Valid fitness methods:
* absolute_error
* squared_error
* root_squared_error
* logarithmic_error
* explog_error
* correlation
* minimize_difference
* akaike_information
* bayesian_information
* maximum_error
* median_error
* implicit_error
* count

For more information about this program, see http://www.hakank.org/eureqa/
Eureqa's homepage: http://ccsl.mae.cornell.edu/eureqa/