Feature selection identifies input variables that contribute to predictions and excludes less-relevant variables. In evolutionary symbolic regression, genetic programming performs this implicitly when its derived equation omits unused inputs. section 4.3.1
A coevolutionary implementation combines feature weighting with equation search:
- Load the BH dataset, transpose its feature matrix, and derive the number of inputs. section 4.3.1
- Create a genetic-algorithm individual containing one scaler gene per input feature. section 4.3.1
- Create a genetic-programming population that evolves symbolic regression equations. section 4.3.1
- Evaluate paired GA and GP individuals by scaling inputs, computing predictions, and measuring their error. section 4.3.1
- Use crossover, mutation, selection, and repeated fitness evaluation to coevolve scalers and equations. section 4.3.1
Symbolic regression on the BH dataset
A resulting equation used only ARG5, ARG7, ARG10, ARG11, and ARG12 from 13 inputs. The omitted features were thereby selected out by the GP solution. section 4.3.1
Listing 4.15 EDL_4_3_COEV_Regression.ipynb: The fitness evaluation
def evalSymbReg(individual, points):
func = toolbox_gp.compile(expr=individual) #1
p = np.expand_dims(points, axis=1) #2
x = X * np.asarray(p) #3
diff = math.sqrt(np.sum((func(*x.tolist()) - y)**2)) #4
return diff,
Inspect the compact fitness function that compiles the GP equation, scales feature inputs with GA values, and returns prediction error. section 4.3.1







