Problems P1-P7

These seven problems are introduced studied in the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

dcgpy.generate_P1()

Generates the problem P1 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = x^5 - \pi x^3 + x\]

x is sampled in ten equally spaced points in [1,3].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P1()
>>> plt.plot(X,Y, '.')
dcgpy.generate_P2()

Generates the problem P2 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = x^5 - \pi x^3 + \frac{\pi}{x}\]

x is sampled in ten equally spaced points in [0.1,5].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P2()
>>> plt.plot(X,Y, '.')
dcgpy.generate_P3()

Generates the problem P3 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = \frac{e x^5 + x^3}{x+1}\]

x is sampled in ten equally spaced points in [-0.9,1].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P3()
>>> plt.plot(X,Y, '.')
dcgpy.generate_P4()

Generates the problem P4 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = \sin(\pi x) + \frac 1x\]

x is sampled in ten equally spaced points in [-1,1].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P4()
>>> plt.plot(X,Y, '.')
dcgpy.generate_P5()

Generates the problem P5 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = e x^5 - \pi x^3 + x\]

x is sampled in ten equally spaced points in [1,3].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P5()
>>> plt.plot(X,Y, '.')
dcgpy.generate_P6()

Generates the problem P6 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = \frac{e x^2 - 1}{\pi (x + 2)}\]

x is sampled in ten equally spaced points in [-2.1,1].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P6()
>>> plt.plot(X,Y, '.')
dcgpy.generate_P7()

Generates the problem P7 from the paper:

Izzo, Dario, Francesco Biscani, and Alessio Mereta. “Differentiable genetic programming.” European Conference on Genetic Programming. Springer, 2017.

The functional form of such a problem is:

\[y = \cos(\pi x) + \sin(e x)\]

x is sampled in ten equally spaced points in [-1,1].

Returns

A tuple containing the points (2D NumPy float array) and labels (2D NumPy float array).

Examples:

>>> from dcgpy import *
>>> import matplotlib.pyplot as plt
>>> X, Y = generate_P7()
>>> plt.plot(X,Y, '.')