liveBook · Manning

Feature selection

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Feature selection is the process of identifying and retaining input variables that contribute to a model's predictions while excluding less-relevant variables.

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

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Demonstrates dataset preparation, toolbox construction, fitness evaluation, and evolution, but does not develop selection theory.
Examples
Uses the BH dataset, a 13-input equation, selected ARG variables, and executable DEAP-style evolution listings.
What you can do after
Apply coevolved genetic programming and genetic algorithms to discover equations that ignore less-relevant features.
How it connects
Connects feature selection with genetic programming, genetic algorithms, symbolic regression, and evolutionary computation.

Also explained in

Compare how 8 books explain feature selection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.