Spaces:
Sleeping
Sleeping
update closest samples code
Browse files- closest_sample.py +1 -1
closest_sample.py
CHANGED
@@ -34,7 +34,7 @@ def pca_distance(pca,sample,embedding,top_k):
|
|
34 |
distances = np.linalg.norm(all - s, axis=1)
|
35 |
sorted_indices = np.argsort(distances)
|
36 |
filtered_indices = sorted_indices[sorted_indices<=2852] # exclude general fossils, keep florissant only.
|
37 |
-
top_indices = np.concatenate([filtered_indices[:2], filtered_indices[3:top_k+1]])
|
38 |
return top_indices
|
39 |
|
40 |
def return_paths(argsorted,files):
|
|
|
34 |
distances = np.linalg.norm(all - s, axis=1)
|
35 |
sorted_indices = np.argsort(distances)
|
36 |
filtered_indices = sorted_indices[sorted_indices<=2852] # exclude general fossils, keep florissant only.
|
37 |
+
top_indices = filtered_indices[:top_k+1] #np.concatenate([filtered_indices[:2], filtered_indices[3:top_k+1]])
|
38 |
return top_indices
|
39 |
|
40 |
def return_paths(argsorted,files):
|