liveBook · Manning

Principal component

As explained in Cyber Threat Hunting

A principal component is a derived feature formed by combining original features and representing a direction of variation in the data.

A principal component is a new, independent feature formed by combining correlated original features. PCA uses these components to reduce dimensionality while preserving as much data variance, or information, as possible. section 9.2.5

A practical PCA workflow is:

  • Split the feature data into training and testing sets, then check class balance. section 9.2.5
  • Scale the training features to mean 0 and standard deviation 1 with StandardScaler. section 9.2.5

Four-component representation

Applying PCA(n_components=4) to X_train_scaled produces X_train_pca with columns PC1, PC2, PC3, and PC4. Plotting PC1 against PC2, or PC3 against PC4, helps compare the transformed data by class.

How Cyber Threat Hunting covers it

How deep it goes
Defines component formation and demonstrates scaling, variance inspection, transformation, and visualization without deriving the underlying mathematics.
Examples
Uses X_train_scaled, four transformed columns, cumulative-variance plots, and class-colored PC1–PC2 and PC3–PC4 plots.
What it assumes
Assumes feature data and supervised train-test preparation, while demonstrating scaling before PCA from the preparation stage.
What you can do after
Apply PCA via scikit-learn after scaling features and choose a component count using cumulative explained variance.
How it connects
Connects dimensionality reduction with correlated features, feature scaling, explained variance, and supervised machine learning.

Also explained in

Compare how 5 books explain principal component →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Cyber Threat Hunting. The section links point to the parts of the book it draws on.