Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDA.py矩阵乘法使用错误 #5

Open
hehe12301 opened this issue Jun 1, 2023 · 0 comments
Open

LDA.py矩阵乘法使用错误 #5

hehe12301 opened this issue Jun 1, 2023 · 0 comments

Comments

@hehe12301
Copy link

code

S = np.linalg.inv(Sw)*SB

Sw和SB都是ndarray,那么这里的乘号含义应该是矩阵各个位置相乘。如果我没有搞错的话,应该改为矩阵乘法(.dot)才对吧?

这样改的话,结果跟sklearn里边的也比较像。
图片

reconstruct版里边的实现和这个一样。我不确定仓库里是否有其他类似问题。

(写作业的时候发现对不上,研究了好久。说实话,numpy里边一种乘号还能有两种意义的,实在是令人震惊...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant