Implement PCA from scratch by centering data, decomposing covariance, and projecting onto leading components.