Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8b09aa4
Change default AMST approx bound value to 1.1
KIwabuchi Aug 7, 2026
a8e6204
Use MFC by default
KIwabuchi Aug 7, 2026
805652b
Brush up scripts
KIwabuchi Aug 8, 2026
6932cc6
Update bench scripts
KIwabuchi Aug 8, 2026
3ad72d6
Update bench scripts
KIwabuchi Aug 8, 2026
e10e513
Minor code brush ups
KIwabuchi Aug 10, 2026
5c17de2
Update bench script
KIwabuchi Aug 11, 2026
8189ff9
Assign clusters to noise points
KIwabuchi Aug 13, 2026
495a903
Add copy_pm_datastore
KIwabuchi Aug 13, 2026
a7f510d
Fix build error in cluster_noise_points.cpp
KIwabuchi Aug 13, 2026
726511f
Improve run_clams_bench.py
KIwabuchi Aug 13, 2026
756c207
Enhance clustering evaluation and correlation analysis
KIwabuchi Sep 4, 2026
cc8f3e2
Merge remote-tracking branch 'upstream/develop' into feature/brush_up…
KIwabuchi Sep 4, 2026
0c57721
Enhance documentation for kNNG functions and correlation evaluation
KIwabuchi Sep 4, 2026
b4f47fd
Refactor clustering evaluation output and streamline echo statements …
KIwabuchi Sep 4, 2026
c200068
Refactor clustering execution logic into a dedicated function for imp…
KIwabuchi Sep 4, 2026
2f02c26
Minor bugfix in cluster_noise_points.cpp
KIwabuchi Sep 4, 2026
c030037
Minor bugfix in cluster_noise_points.cpp
KIwabuchi Sep 4, 2026
4dda3ca
Brush up benchmark scripts
KIwabuchi Sep 4, 2026
15acaa4
Brush up benchmark scripts
KIwabuchi Sep 4, 2026
b0b78d9
Brush up benchmark scripts
KIwabuchi Sep 4, 2026
17ec574
Update output header in extract_clams_clustering_time.sh
KIwabuchi Sep 5, 2026
c66d607
Merge remote-tracking branch 'upstream/develop' into feature/brush_up…
KIwabuchi Sep 5, 2026
3ab6ad5
Bugfix: fix to detect noise points correctly.
KIwabuchi Sep 6, 2026
1ca4060
Brush up on the HDBSCAN script
KIwabuchi Sep 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ general approach taken is to take the standard HDBSCAN algorithm and swap compon
non-Euclidean data for scalable primitives. This often requires resorting to algorithms that are approximations of what
is done in HDBSCAN, sometimes without approximation guarantees.

Note: This code works best if the input data is de-duplicated, with exact duplicate points removed.
Note: This code works best if the input data is de-duplicated, with exact duplicate points removed.
If not, HDBSCAN will identify clusters with duplicate points as highly stable and always select them.


Expand Down Expand Up @@ -84,7 +84,7 @@ source ./venv/bin/activate
# In clams/build
# -m: min cluster size
# -s: min samples
python3 ../script/benchmark/hdbscan/run_hdbscan.py -m 10 -s 5 -p ../dataset/fashion-mnist/points.txt -g ../dataset/fashion-mnist/labels.txt
python3 ../script/benchmark/hdbscan_benchmark/run_hdbscan.py -m 10 -s 5 -p ../dataset/fashion-mnist/points.txt -g ../dataset/fashion-mnist/labels.txt
```

# License
Expand Down
24 changes: 14 additions & 10 deletions script/benchmark/clustering_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ def eval_clusters(cluster_labels, true_labels, singleton_cluster_to_noise_points
print(f"After filtering: {len(true_labels)} ground truth points")

non_noise_points_mask = (cluster_labels >= 0)
pct_clustered = (np.sum(non_noise_points_mask) / cluster_labels.shape[0])
print(f"Cluster coverage (%): {pct_clustered * 100:.2f}")
num_non_noise_points = np.sum(non_noise_points_mask)
pct_clustered = (num_non_noise_points / cluster_labels.shape[0])
print(f"Cluster coverage (%): {pct_clustered * 100:.2f}%")

if len(non_noise_points_mask) < cluster_labels.shape[0]: # Has noise points
# Make sure always num_non_noise_points <= cluster_labels.shape[0]
assert num_non_noise_points <= cluster_labels.shape[0]

if num_non_noise_points != cluster_labels.shape[0]: # Has noise points
if singleton_cluster_to_noise_points:
print(
"Assigning a singleton cluster to each noise point in the clustering result")
Expand Down Expand Up @@ -99,7 +103,7 @@ def find_files_in_dir(dir_path, ext=''):
# If the first column is not a point ID, set has_ids to False.
# If there are multiple files in a directory, the point IDs must be present.
def read_point_data(data_path, has_ids=True):
print(f"Loading data from {data_path}")
print(f"Loading data from {data_path}", flush=True)
files = find_files_in_dir(data_path)

if len(files) == 0:
Expand Down Expand Up @@ -137,7 +141,7 @@ def read_point_data(data_path, has_ids=True):

points_table[pid] = list(map(float, items))

print(f"Loaded {len(points_table)} items from {len(files)} files")
print(f"Loaded {len(points_table)} items from {len(files)} files", flush=True)

# numpy array of feature vectors
# if the IDs are not continuous, fill the missing IDs with -1
Expand Down Expand Up @@ -167,7 +171,7 @@ def read_point_data(data_path, has_ids=True):
#
# Both File types can also contain comment lines, which must start from #.
def read_label_data(data_path):
print(f"Loading data from {data_path}")
print(f"Loading data from {data_path}", flush=True)
labels_dict = {}
files = []
if os.path.isdir(data_path):
Expand All @@ -186,9 +190,9 @@ def read_label_data(data_path):
break

if contains_ids:
print("Loading point IDs and labels")
print("Loading point IDs and labels", flush=True)
else:
print("Loading only labels")
print("Loading only labels", flush=True)

if len(files) > 1 and not contains_ids:
print("Multiple files are provided,"
Expand Down Expand Up @@ -220,8 +224,8 @@ def read_label_data(data_path):
exit(1)
labels_dict[pid] = label

print(f"Loaded {len(labels_dict)} items from {len(files)} files")
print(f"Max ID: {max_id}")
print(f"Loaded {len(labels_dict)} items from {len(files)} files", flush=True)
print(f"Max ID: {max_id}", flush=True)

# numpy array of labels
# if the IDs are not continuous, fill the missing IDs with -1
Expand Down
2 changes: 1 addition & 1 deletion script/benchmark/extract_clams_clustering_time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [[ $# -eq 0 ]]; then
exit 1
fi

printf "kNNG k,nodes,tasks/node,kNNG (s),MFC (s),AMST (s),CLAMS-HDBSCAN (s),Assigning noise points (s),file\n"
printf "kNNG k,nodes,tasks/node,kNNG (s),MFC (s),AMST (s),CLAMS-HDBSCAN (s),Noise clustering (s),file\n"

for file in "$@"; do
awk -v fname="$file" '
Expand Down
188 changes: 0 additions & 188 deletions script/benchmark/hdbscan/run_hdbscan.py

This file was deleted.

35 changes: 0 additions & 35 deletions script/benchmark/hdbscan/test_hdbscan_clustering.sh

This file was deleted.

Loading
Loading