Пример #1
0
from sklearn.metrics import mean_absolute_error as mae
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import graphviz
import gplearn.functions as gpn

rng = check_random_state(0)
#Create the base data

x = rng.uniform(0.001, 10.001, 50)

y = rng.uniform(0.001, 1, 50)

x, y = np.meshgrid(x, y)
z = gpn.log1(x / y)

#Create Training sample
x_train = rng.uniform(0.001, 10.001, 50)

y_train = rng.uniform(0.001, 1, 50)

trainSet = []
for i in range(len(x_train)):
    trainSet.append([x_train[i], y_train[i]])
z_train = gpn.log1(x_train / y_train)

#Create Testing sample
x_test = rng.uniform(0.001, 10.001, 50)

y_test = rng.uniform(0.001, 1, 50)
Пример #2
0
from sklearn.metrics import mean_absolute_error as mae
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import graphviz
import gplearn.functions as gpn

rng = check_random_state(0)
#Create the base data

x = rng.uniform(0.001, 10.0001, 50)

y = rng.uniform(0, 10.0001, 50)

x, y = np.meshgrid(x, y)
z = gpn.abs1(gpn.inv1(x) * gpn.log1(8 * y))

#Create Training sample
x_train = rng.uniform(0.001, 10.0001, 50)

y_train = rng.uniform(0, 10.0001, 50)

trainSet = []
for i in range(len(x_train)):
    trainSet.append([x_train[i], y_train[i]])
z_train = gpn.abs1(gpn.inv1(x_train) * gpn.log1(8 * y_train))

#Create Testing sample
x_test = rng.uniform(0.001, 10.0001, 50)
y_test = rng.uniform(0, 10.0001, 50)
testSet = []
Пример #3
0
import numpy as np
import graphviz
import gplearn.functions as gpn

rng = check_random_state(0)

#Create the base data
x = rng.uniform(0.001, 10, 50)
y = rng.uniform(-10, -0.001, 50)
realSet = []
for i in range(len(x)):
    realSet.append([x[i], y[i]])
x, y = np.meshgrid(x, y)
z = (x / y) + gpn.cos1(
    2 * x) - gpn.sin1(3 * y) * gpn.max2(6 * x + 10, 2 * y - 8)
-gpn.min2(y + 5, 3 * x) + gpn.inv1(y) - gpn.tan1(x) * gpn.log1(x)
+gpn.sqrt1(x) * gpn.abs1(-2 * x)
'''
ax = plt.figure().gca(projection='3d')
ax.set_xlim(0, 10)
ax.set_ylim(-10, 0)
surf = ax.plot_surface(x, y, z, rstride=1, cstride=1, color='green', alpha=0.5)
#plt.show()
'''

#Create Training sample
x_train = rng.uniform(0.001, 10, 50)
y_train = rng.uniform(-10, -0.001, 50)
trainSet = []
for i in range(len(x_train)):
    trainSet.append([x_train[i], y_train[i]])
Пример #4
0
import matplotlib.pyplot as plt
import numpy as np
import graphviz
import gplearn.functions as gpn



rng = check_random_state(0)
#Create the base data

x = rng.uniform(-10, 10.0001, 50)

y = rng.uniform(-10, 10.0001, 50)

x, y = np.meshgrid(x, y)
z = gpn.log1(x * y)

#Create Training sample
x_train = rng.uniform(-10, 0, 50)

y_train = rng.uniform(0, 10.0001, 50)

trainSet = []
for i in range (len(x_train)):
    trainSet.append([x_train[i], y_train[i]])
z_train = gpn.log1(x_train * y_train)

#Create Testing sample
x_test = rng.uniform(-10, 10, 50)
y_test = rng.uniform(-10, 10, 50)
testSet = []
Пример #5
0
import matplotlib.pyplot as plt
import numpy as np
import graphviz
import gplearn.functions as gpn



rng = check_random_state(0)
#Create the base data

x = rng.uniform(-1, 10.001, 50)

y = rng.uniform(2, 10.001, 50)

x, y = np.meshgrid(x, y)
z = gpn.div2(gpn.log1(5*x +8), gpn.log1(6*y -2))

#Create Training sample
x_train = rng.uniform(-1, 10.001, 50)

y_train = rng.uniform(2, 10.001, 50)

trainSet = []
for i in range (len(x_train)):
    trainSet.append([x_train[i], y_train[i]])
z_train = gpn.div2(gpn.log1(5*x_train +8), gpn.log1(6*y_train -2))

#Create Testing sample
x_test = rng.uniform(-1, 10.001, 50)
y_test = rng.uniform(2, 10.001, 50)
testSet = []