symbol regression problem it is one of the best known problems in genetic programming all symbolic regression problems use an arbitrary data distributionand try to fit the most accurate data with symbolic formula usuallya measure like the rmse (root mean square erroris used to measure an individual' fitness it is classic regressor problem and here we are using the equation we need to follow all the steps as followed in the above examplebut the main part would be to create the primitive sets because they are the building blocks for the individuals so the evaluation can start here we will be using the classic set of primitives the following python code explains this in detailimport operator import math import random import numpy as np from deap import algorithmsbasecreatortoolsgp def division_operator(numeratordenominator)if denominator = return return numerator denominator def eval_func(individualpoints)func toolbox compile(expr=individualmse ((func( ( ** ** ))** for in pointsreturn math fsum(mselen(points)def create_toolbox()pset gp primitiveset("main" pset addprimitive(operator add pset addprimitive(operator sub pset addprimitive(operator mul pset addprimitive(division_operator pset addprimitive(operator neg pset addprimitive(math cos pset addprimitive(math sin pset addephemeralconstant("rand "lambdarandom randint(- , )pset renamearguments(arg =' 'creator create("fitnessmin"base fitnessweights=(- ,)creator create("individual",gp primitivetree,fitness=creator fitnessmintoolbox base toolbox(toolbox register("expr"gp genhalfandhalfpset=psetmin_= max_=