← All tutorials

GoCareerGo Tutorials

Machine Learning Tutorial

Supervised learning, classification, neural networks and core ML algorithms.

Principal Component Analysis (PCA)

A dimensionality-reduction technique that projects data onto the directions (principal components) that capture the most variance.

from sklearn.decomposition import PCA

pca = PCA(n_components=2)
reduced = pca.fit_transform(X)
  • Useful for visualization (reducing to 2-3 dimensions) and speeding up training
  • Components are ordered by how much variance they explain
  • Always standardize features before PCA — it's sensitive to scale