Skip to content

Commit

Permalink
Merge pull request parthsarthi03#16 from LLLeoLi/fix-bug-TypeError-Ca…
Browse files Browse the repository at this point in the history
…nnot-use-scipy.linalg.eigh-for-sparse-A-with-k-=-N.-Use-scipy.linalg.eigh(A.toarray())-or-reduce-k-

change the dim to a safe n_components
  • Loading branch information
parthsarthi03 authored Mar 21, 2024
2 parents 9d99cbd + 04f73b3 commit 2e3e83e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion raptor/cluster_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def GMM_cluster(embeddings: np.ndarray, threshold: float, random_state: int = 0)
def perform_clustering(
embeddings: np.ndarray, dim: int, threshold: float, verbose: bool = False
) -> List[np.ndarray]:
reduced_embeddings_global = global_cluster_embeddings(embeddings, dim)
reduced_embeddings_global = global_cluster_embeddings(embeddings, min(dim, len(embeddings) -2))
global_clusters, n_global_clusters = GMM_cluster(
reduced_embeddings_global, threshold
)
Expand Down

0 comments on commit 2e3e83e

Please sign in to comment.