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

遇到了一个问题 #1

Open
jyyang621 opened this issue Apr 19, 2022 · 3 comments
Open

遇到了一个问题 #1

jyyang621 opened this issue Apr 19, 2022 · 3 comments

Comments

@jyyang621
Copy link

请问test的最后一行为什么运行不了呢?
image

@jyyang621
Copy link
Author

jyyang621 commented Aug 8, 2022 via email

@linguiqiu
Copy link

(我又来了,上午回复过删掉的)是因为find_closest_cluster_center函数中distance = np.power((cluster_centers - data[i, :]), 2)这一句出错了,聚类中心和数据形状不一致导致的(可能是稀疏矩阵无法直接相减导致的?),直接在原函数中改成 distance = np.power((cluster_centers - data[i, :].toarray()), 2),同时要记得把__main__函数删掉,它里面调用了iris数据集,iris数据集的形式可能和自己导入的不一样了。

@jyyang621
Copy link
Author

jyyang621 commented Aug 8, 2022 via email

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

2 participants