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

Documents that are used to seed multiple clusters may be lost to clusters #69

Open
kwalcock opened this issue Aug 7, 2023 · 0 comments

Comments

@kwalcock
Copy link
Collaborator

kwalcock commented Aug 7, 2023

In code like this where d2s_extended is added, the values may not make the threshold if the document was included in two clusters. In that case, each gets 0.5 instead of the 1.0, so they will need some help from the seeded_matrix, but may not get it. If they are in three seeded clusters, they get 0.33 each, so it gets less probably that they will make it. This could be a bug or a features. If it is important that they stay in the seeded clusters, the condition might change. They can make the threshold or just be a non-zero in d2s_extended.

def assign_soft_labels(self, d2s_extended):
	# Replace the matrix with the appropriate assignments for the seeded documents:
	seeded_matrix = self.matrix.copy()
	if d2s_extended.size != 0:
		seeded_matrix += d2s_extended # Zeros won't affect non-seeded, but seeded will become greater than one and thus will always match the threshold
	self.clusters = list(map(lambda i: self.documents[np.where(seeded_matrix[:, i] >= self.threshold)[0]], range(seeded_matrix.shape[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