データセットの主成分分析の実践的な例を示す利用可能な例はありますか?私は理論のみを説明する記事を読んでおり、PCAの使用方法を示し、結果を解釈して元のデータセットを新しいデータセットに変換する方法を実際に探しています。何か提案はありますか?
1353 次
3 に答える
3
Pythonをご存知の場合は、次の簡単な実践例をご覧ください。
# Generate correlated data from uncorrelated data.
# Each column of X is a 3-dimensional feature vector.
Z = scipy.randn(3, 1000)
C = scipy.randn(3, 3)
X = scipy.dot(C, Z)
# Visualize the correlation among the features.
pylab.scatter(X[0,:], X[1,:])
pylab.scatter(X[0,:], X[2,:])
pylab.scatter(X[1,:], X[2,:])
# Perform PCA. It can be shown that the principal components of the
# matrix X are equivalent to the left singular vectors of X, which are
# equivalent to the eigenvectors of X X^T (up to indeterminacy in sign).
U, S, Vh = scipy.linalg.svd(X)
W, Q = scipy.linalg.eig(scipy.dot(X, X.T))
print U
print Q
# Project the original features onto the eigenspace.
Y = scipy.dot(U.T, X)
# Visualize the absence of correlation among the projected features.
pylab.scatter(Y[0,:], Y[1,:])
pylab.scatter(Y[1,:], Y[2,:])
pylab.scatter(Y[0,:], Y[2,:])
于 2011-05-22T17:30:02.910 に答える
0
http://alias-i.com/lingpipe/demos/tutorial/svd/read-me.htmlを確認できます。SVDとLSAはPCAと非常によく似たアプローチであり、どちらもスペース削減方法です。基礎評価アプローチの唯一の違い。
于 2011-05-20T05:10:16.947 に答える
0
利用可能な実践的な例を求めているので、ここにインタラクティブなデモがあります。
于 2011-05-21T03:17:58.390 に答える