Skip to content

Commit d812ff9

Browse files
author
Alexandr-Solovev
committed
feat(configs): add HDBSCAN benchmark configs
Add sklearnex-vs-sklearn HDBSCAN CPU benchmarks: * configs/common/hdbscan.json - reusable parameter sets (methods, metrics, density/cluster-selection/store_centers sweeps, dtypes, data formats), modelled on the DBSCAN common config * configs/regular/hdbscan.json - tree- and brute-friendly datasets * configs/experiments/hdbscan_parameters.json - parameter space sweeps * configs/experiments/hdbscan_scaling.json - thread/NUMA core scaling plus n_samples and n_features sweeps Two harness fixes are needed to make these runnable: * enrich_result: normalize a `*.preview.*` library to its base library so preview-namespace estimators (sklearnex.preview.cluster.HDBSCAN) are comparable with the stock implementation in the report * box_filter: fall back to the whole series when the 20-80% box is empty, which happens for 2 measurements - a `time_limit` early stop can leave exactly 2 and the aggregated time became NaN
1 parent 9294a43 commit d812ff9

6 files changed

Lines changed: 543 additions & 7 deletions

File tree

‎configs/common/hdbscan.json‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"PARAMETERS_SETS": {
3+
"hdbscan sklearn-ex[cpu] implementations": {
4+
"algorithm": [
5+
{ "library": "sklearn", "device": "cpu" },
6+
{ "library": "sklearnex.preview.cluster", "device": "cpu" }
7+
]
8+
},
9+
"common hdbscan parameters": {
10+
"algorithm": {
11+
"estimator": "HDBSCAN",
12+
"estimator_params": {
13+
"min_cluster_size": 5,
14+
"min_samples": 5,
15+
"metric": "euclidean",
16+
"cluster_selection_method": "eom",
17+
"allow_single_cluster": false,
18+
"store_centers": null,
19+
"copy": false
20+
},
21+
"estimator_methods": { "training": "fit" }
22+
},
23+
"data": { "format": "numpy", "order": "C", "dtype": "float64" },
24+
"bench": { "n_runs": 3, "time_limit": 1200 }
25+
},
26+
"sklearn hdbscan parameters": {
27+
"algorithm": {
28+
"estimator_params": { "n_jobs": "[SPECIAL_VALUE]physical_cpus" }
29+
}
30+
},
31+
"hdbscan brute method": {
32+
"algorithm": { "estimator_params": { "algorithm": "brute" } }
33+
},
34+
"hdbscan kd_tree method": {
35+
"algorithm": { "estimator_params": { "algorithm": "kd_tree", "leaf_size": 40 } }
36+
},
37+
"hdbscan ball_tree method": {
38+
"algorithm": { "estimator_params": { "algorithm": "ball_tree", "leaf_size": 40 } }
39+
},
40+
"hdbscan tree methods": {
41+
"algorithm": {
42+
"estimator_params": { "algorithm": ["kd_tree", "ball_tree"], "leaf_size": 40 }
43+
}
44+
},
45+
"hdbscan all methods": {
46+
"algorithm": {
47+
"estimator_params": {
48+
"algorithm": ["brute", "kd_tree", "ball_tree"],
49+
"leaf_size": 40
50+
}
51+
}
52+
},
53+
"hdbscan tree metrics": {
54+
"algorithm": {
55+
"estimator_params": { "metric": ["euclidean", "manhattan", "chebyshev"] }
56+
}
57+
},
58+
"hdbscan minkowski metric": {
59+
"algorithm": {
60+
"estimator_params": { "metric": "minkowski", "metric_params": { "p": 3 } }
61+
}
62+
},
63+
"hdbscan cosine metric": {
64+
"algorithm": {
65+
"estimator_params": { "metric": "cosine", "algorithm": "brute" }
66+
}
67+
},
68+
"hdbscan cluster selection sweep": {
69+
"algorithm": {
70+
"estimator_params": { "cluster_selection_method": ["eom", "leaf"] }
71+
}
72+
},
73+
"hdbscan density sweep": {
74+
"algorithm": {
75+
"estimator_params": { "min_cluster_size": [5, 25, 100], "min_samples": [5, 25] }
76+
}
77+
},
78+
"hdbscan store centers sweep": {
79+
"algorithm": {
80+
"estimator_params": { "store_centers": [null, "centroid", "medoid", "both"] }
81+
}
82+
},
83+
"hdbscan dtype sweep": {
84+
"data": { "dtype": ["float32", "float64"] }
85+
},
86+
"hdbscan data format sweep": {
87+
"data": [
88+
{ "format": "numpy", "order": "C" },
89+
{ "format": "numpy", "order": "F" },
90+
{ "format": "pandas", "order": "F" }
91+
]
92+
}
93+
}
94+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"INCLUDE": ["../common/hdbscan.json"],
3+
"PARAMETERS_SETS": {
4+
"hdbscan parameters data [tree]": {
5+
"data": {
6+
"source": "make_blobs",
7+
"generation_kwargs": {
8+
"centers": 10,
9+
"n_samples": 100000,
10+
"n_features": 8,
11+
"cluster_std": 2.0,
12+
"random_state": 42
13+
},
14+
"split_kwargs": { "ignore": true }
15+
}
16+
},
17+
"hdbscan parameters data [brute]": {
18+
"data": {
19+
"source": "make_blobs",
20+
"generation_kwargs": {
21+
"centers": 10,
22+
"n_samples": 25000,
23+
"n_features": 64,
24+
"cluster_std": 4.0,
25+
"random_state": 42
26+
},
27+
"split_kwargs": { "ignore": true }
28+
}
29+
},
30+
"hdbscan parameters data [real]": {
31+
"data": {
32+
"dataset": "skin_segmentation",
33+
"split_kwargs": { "train_size": 30000 },
34+
"preprocessing_kwargs": { "normalize": "standard" }
35+
}
36+
}
37+
},
38+
"TEMPLATES": {
39+
"hdbscan metrics [tree]": {
40+
"SETS": [
41+
"hdbscan sklearn-ex[cpu] implementations",
42+
"common hdbscan parameters",
43+
"sklearn hdbscan parameters",
44+
"hdbscan tree methods",
45+
"hdbscan tree metrics",
46+
"hdbscan parameters data [tree]"
47+
]
48+
},
49+
"hdbscan minkowski [tree]": {
50+
"SETS": [
51+
"hdbscan sklearn-ex[cpu] implementations",
52+
"common hdbscan parameters",
53+
"sklearn hdbscan parameters",
54+
"hdbscan kd_tree method",
55+
"hdbscan minkowski metric",
56+
"hdbscan parameters data [tree]"
57+
]
58+
},
59+
"hdbscan metrics [brute]": {
60+
"SETS": [
61+
"hdbscan sklearn-ex[cpu] implementations",
62+
"common hdbscan parameters",
63+
"sklearn hdbscan parameters",
64+
"hdbscan brute method",
65+
"hdbscan tree metrics",
66+
"hdbscan parameters data [brute]"
67+
]
68+
},
69+
"hdbscan cosine [brute]": {
70+
"SETS": [
71+
"hdbscan sklearn-ex[cpu] implementations",
72+
"common hdbscan parameters",
73+
"sklearn hdbscan parameters",
74+
"hdbscan cosine metric",
75+
"hdbscan parameters data [brute]"
76+
]
77+
},
78+
"hdbscan cluster selection": {
79+
"SETS": [
80+
"hdbscan sklearn-ex[cpu] implementations",
81+
"common hdbscan parameters",
82+
"sklearn hdbscan parameters",
83+
"hdbscan kd_tree method",
84+
"hdbscan cluster selection sweep",
85+
"hdbscan parameters data [tree]"
86+
]
87+
},
88+
"hdbscan density": {
89+
"SETS": [
90+
"hdbscan sklearn-ex[cpu] implementations",
91+
"common hdbscan parameters",
92+
"sklearn hdbscan parameters",
93+
"hdbscan kd_tree method",
94+
"hdbscan density sweep",
95+
"hdbscan parameters data [tree]"
96+
]
97+
},
98+
"hdbscan store centers": {
99+
"SETS": [
100+
"hdbscan sklearn-ex[cpu] implementations",
101+
"common hdbscan parameters",
102+
"sklearn hdbscan parameters",
103+
"hdbscan kd_tree method",
104+
"hdbscan store centers sweep",
105+
"hdbscan parameters data [tree]"
106+
]
107+
},
108+
"hdbscan dtypes": {
109+
"SETS": [
110+
"hdbscan sklearn-ex[cpu] implementations",
111+
"common hdbscan parameters",
112+
"sklearn hdbscan parameters",
113+
"hdbscan all methods",
114+
"hdbscan dtype sweep",
115+
"hdbscan parameters data [real]"
116+
]
117+
},
118+
"hdbscan data formats": {
119+
"SETS": [
120+
"hdbscan sklearn-ex[cpu] implementations",
121+
"common hdbscan parameters",
122+
"sklearn hdbscan parameters",
123+
"hdbscan kd_tree method",
124+
"hdbscan data format sweep",
125+
"hdbscan parameters data [tree]"
126+
]
127+
}
128+
}
129+
}

0 commit comments

Comments
 (0)