sketching pca pca involves lot of linear algebrawhich we do not want to go into neverthelessthe basic algorithm can be easily described with the help of the following steps center the data by subtracting the mean from it calculate the covariance matrix calculate the eigenvectors of the covariance matrix if we start with featuresthe algorithm will again return transformed feature space with dimensions we gained nothing so far the nice thing about this algorithmhoweveris that the eigenvalues indicate how much of the variance is described by the corresponding eigenvector featuresand we know that our model does let us assume we start with not work well with more than features then we simply pick the eigenvectors having the highest eigenvalues applying pca let us consider the following artificial datasetwhich is visualized in the left plot as followsx np arange( +np random normal(loc= scale= size=len( ) np c_[( )good ( > ( > some arbitrary classes bad ~good to make the example look good