Kuautli commited on
Commit
e43ee2d
·
verified ·
1 Parent(s): 144ebe3

Update clustering.py

Browse files
Files changed (1) hide show
  1. clustering.py +5 -4
clustering.py CHANGED
@@ -598,11 +598,12 @@ def create_3d_umap_plot(data):
598
  fig.show()
599
 
600
 
601
- def perform_clustering(data, min_eps, max_eps=0.95, n=5, embeddings_col="embeddings"):
602
 
603
- embeddings_matrix = np.array(data[embeddings_col].tolist())
604
- # threshold_values = np.round(np.linspace(min_eps, max_eps, n), 2)
605
- threshold_values = np.linspace(min_eps, max_eps, n)
 
606
 
607
  cluster_assignments = {}
608
  cluster_counts = {}
 
598
  fig.show()
599
 
600
 
601
+ def perform_clustering(data, min_eps, max_eps=0.95, n=5, threshold_values=None, embeddings_col="embeddings"):
602
 
603
+ if not threshold_values:
604
+ embeddings_matrix = np.array(data[embeddings_col].tolist())
605
+ # threshold_values = np.round(np.linspace(min_eps, max_eps, n), 2)
606
+ threshold_values = np.linspace(min_eps, max_eps, n)
607
 
608
  cluster_assignments = {}
609
  cluster_counts = {}