import math from sklearn.utils.random import check_random_state 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(-10, 10.0001, 50) y = rng.uniform(-10, -0.001, 50) x, y = np.meshgrid(x, y) z = (x / y) * gpn.inv1(y) #Create Training sample x_train = rng.uniform(-10, 10, 50) y_train = rng.uniform(0.001, 10, 50) trainSet = [] for i in range(len(x_train)): trainSet.append([x_train[i], y_train[i]]) z_train = (x_train / y_train) * gpn.inv1(y_train) #Create Testing sample x_test = rng.uniform(-10, 10, 50) y_test = rng.uniform(0.001, 10, 50) testSet = [] for i in range(len(x_test)): testSet.append([x_test[i], y_test[i]])
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 = []
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(-10, 10.0001, 50) y = rng.uniform(-10, 10.0001, 50) x, y = np.meshgrid(x, y) z = gpn.inv1(x - y) #Create Training sample x_train = rng.uniform(-10, 10.0001, 50) y_train = rng.uniform(-0.001, 0.001001, 50) trainSet = [] for i in range(len(x_train)): trainSet.append([x_train[i], y_train[i]]) z_train = gpn.inv1(x_train - y_train) #Create Testing sample x_test = rng.uniform(-10, 10, 50) y_test = rng.uniform(-10, 10, 50) testSet = []
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(-10, 10.0001, 50) y = rng.uniform(-10, -0.001, 50) x, y = np.meshgrid(x, y) z = gpn.div2(x, y) + gpn.inv1(y) #Create Training sample x_train = rng.uniform(-10, 10.0001, 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]]) z_train = gpn.div2(x_train, y_train) + gpn.inv1(y_train) #Create Testing sample x_test = rng.uniform(-10, 10, 50) y_test = rng.uniform(-10, -0.001, 50) testSet = []
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, 10.001, 50) y = rng.uniform(0, 10.001, 50) x, y = np.meshgrid(x, y) z = gpn.sqrt1(gpn.cos1(x) * gpn.inv1(gpn.sin1(y))) #Create Training sample x_train = rng.uniform(0, 10.001, 50) y_train = rng.uniform(0, 10.001, 50) trainSet = [] for i in range (len(x_train)): trainSet.append([x_train[i], y_train[i]]) z_train = gpn.sqrt1(gpn.cos1(x_train) * gpn.inv1(gpn.sin1(y_train))) #Create Testing sample x_test = rng.uniform(0, 10.0001, 50) y_test = rng.uniform(0, 10.0001, 50) testSet = []
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]])