liveBook · Manning

Principal component analysis

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

Principal component analysis is a dimensionality-reduction technique that transforms correlated multidimensional data into a smaller set of components capturing variation in the data.

Principal component analysis (PCA) reduces multidimensional vector data to fewer dimensions, making otherwise high-dimensional hyperparameter results easier to visualize in two or three dimensions. section 5.5.2

PCA works by:

  • Projecting higher-dimensional data into a lower-dimensional space. section 5.5.2
  • Calculating components from variance, with each axis representing relative distances between elements in vector space. section 5.5.2
  • Supporting visualization while additional hyperparameters vary during automated optimization. section 5.5.2 section 5.7

Reducing four dimensions to two

Create a scikit-learn PCA object with n_components=2, call fit_transform on four-dimensional population data, transpose the result, and scatter-plot its two component axes. section 5.5.2

Listing 5.27 EDL_5_5_ES_HPO_PCA.ipynb: Adding PCA
pop = np.array([[-.5, .75, -.1, .8], 
                [-.5, -.3, -.5, .8],
                [-.5, 1, -.5, -.8],
                [ 1, -.3, -.5, .8]])      #1
pca = PCA(n_components=2)                 #2
reduced = pca.fit_transform(pop)          #3
 
t = reduced.transpose()                   #4
 
plt.scatter(t[0], t[1])                   #5
plt.show()

The runnable listing demonstrates PCA setup, transformation, and plotting on contrived four-dimensional data. section 5.5.2

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

How deep it goes
Explains projection, variance-based components, and implementation, but defers detailed algorithmic treatment to documentation or other resources.
Examples
Uses four-dimensional contrived population data, scatter plots, and fitness-evaluation hexbin plots.
What it assumes
Assumes multidimensional vector data and hyperparameter-optimization results while providing a simple implementation from the transformation setup onward.
What you can do after
Apply it via scikit-learn to transform multidimensional optimization data and inspect search behavior through two-dimensional plots.
How it connects
Connects dimensionality reduction with hyperparameter optimization, evolutionary search, grid search, and random search.

Also explained in

Compare how 10 books explain principal component analysis →

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.