PCA (Principal Component Analysis) and LDA (Linear discriminant analysis) implementation from scratch