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