For example, given a set of vectors from images of faces, I could reduce the dimensions:
pca = PCA(n_components=100, svd_solver='randomized', whiten=True) pca.fit(faces) compressed = pca.transform(faces)
But when I look at the results, I see nothing like an image:
example = compressed example *= 255.0 example = example.astype('uint8') example = example.reshape((10,10)) output = Image.fromarray(example) output = output.resize((200,200)) output.save('ExamplePCA.jpg')
Can someone describe for me (someone with limited matrix math/linear algebra knowledge) what is being represented here?