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

biKmeans error in kmeans #6

Open
kittyonex1 opened this issue Jul 28, 2018 · 0 comments
Open

biKmeans error in kmeans #6

kittyonex1 opened this issue Jul 28, 2018 · 0 comments

Comments

@kittyonex1
Copy link

        # 获得其他簇的样本
        ptsNoInCluster = dataSet[np.nonzero(
            clusterAssment[:, 0].A != j)[0]]
        # 获得剩余数据集的误差
        nonSplitedError = np.sum(ptsNoInCluster[:, 1])

获得剩余数据集的误差不需要dataSet,而是clusterAssment
即整体改为:
# 获得剩余数据集的误差
nonSplitedError = np.sum(clusterAssment[np.nonzero(
clusterAssment[:, 0].A != j)[0]][:, 1])

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