MachineLearning/pca library

📐 Principal Component Analysis (PCA)

A minimalist PCA implementation using the covariance method and power-iteration for the top components. Focused on clarity and good docstring quality for engineering usage. Returns projected data and principal components.

Contract:

  • Input: X (n x m), desired number of components d.
  • Output: projected matrix (n x d) and components (d x m).
  • Error: throws ArgumentError for invalid shapes.

Time Complexity: O(n * m * d * iters) Space Complexity: O(m*m)

Classes

PCA