0
我嘗試使用Python sklearn對breast_canser數據集進行主成分分析。 並且不明白爲什麼特徵向量的點積(3個分量)不是零?主成分分析 - 爲什麼特徵向量的點積不是零?
frst = pca.components_[0,:]
scnd = pca.components_[1,:]
thrd = pca.components_[2,:]
orth1 = np.dot(frst,scnd)
orth2 = np.dot(scnd, thrd)
print(orth1.real)
print(orth2.real)
出:
0.0
1.52655665886e-16
可能重複[浮點數學是否被破壞?](https://stackoverflow.com/questions/588004/is-floating-point-math-broken) – Sneftel