Skip to content

Commit

Permalink
Fix cluster membership evaluation by skipping inactive members
Browse files Browse the repository at this point in the history
- Added a condition to the ClusterGroup class to continue the loop if a cluster member's state is -1, ensuring that inactive members are not considered in the similarity calculations. This change enhances the accuracy of cluster membership evaluations.
  • Loading branch information
Brian Joseph Petro committed Jan 22, 2025
1 parent b0bf266 commit 475a5ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions smart-cluster-groups/cluster_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class ClusterGroup extends CollectionItem {
};
for(let j = 0; j < this.clusters.length; j++) {
const cluster = this.clusters[j];
if(cluster.data.members[item.key]?.state === -1) continue;
const sim = cos_sim(cluster.vec, item.vec);
membership.clusters[cluster.key] = {
score: sim,
Expand Down

0 comments on commit 475a5ba

Please sign in to comment.