我使用以下功能将32 * 32图像数据(eigenface)投影到主要组件上。
def projectData(X, U, K):
# Compute the projection of the data using only the top K eigenvectors in U (first K columns).
# X: data
# U: Eigenvectors
# K: your choice of dimension
new_U = U[:,:K]
return X.dot(new_U)
假设我的K是10.现在我有100维数据而不是1024(32 * 32)。 当我显示我在图像下面的数据时。
这是正常行为吗? 我正在关注Andrew NG的PC课程(https://github.com/kaleko/CourseraML/blob/master/ex7/ex7.ipynb)并注意到该课程中没有教程显示p 投影数据本身,但他们总是显示重建版本(通过将数据投影回原始的高维空间来恢复数据,然后显示)
我的问题是: 我该如何显示投影数据?显示投影数据本身是否有意义?为什么所有其他教程都会恢复数据然后显示?