Skip to content

Commit 9a4f1d9

Browse files
minor
1 parent fbb39b6 commit 9a4f1d9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

algo/src/main/java/org/neo4j/gds/hdbscan/HDBScan.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public class HDBScan extends Algorithm<HugeLongArray> {
3737
private final Concurrency concurrency;
3838
private final long leafSize;
3939
private final TerminationFlag terminationFlag;
40-
private final int k;
40+
private final int samples;
4141
private final long minClusterSize;
4242

4343
protected HDBScan(
4444
IdMap nodes,
4545
NodePropertyValues nodePropertyValues,
4646
Concurrency concurrency,
4747
long leafSize,
48-
int k,
48+
int samples,
4949
long minClusterSize,
5050
ProgressTracker progressTracker,
5151
TerminationFlag terminationFlag
@@ -55,7 +55,7 @@ protected HDBScan(
5555
this.nodePropertyValues = nodePropertyValues;
5656
this.concurrency = concurrency;
5757
this.leafSize = leafSize;
58-
this.k = k;
58+
this.samples = samples;
5959
this.minClusterSize = minClusterSize;
6060
this.terminationFlag = terminationFlag;
6161
}
@@ -66,13 +66,12 @@ public HugeLongArray compute() {
6666

6767
var nodeCount = nodes.nodeCount();
6868
var coreResult = computeCores(kdTree, nodeCount);
69-
// var dualTreeMST = dualTreeMSTPhase();
7069
var dualTreeMST = dualTreeMSTPhase(kdTree, coreResult);
7170
var clusterHierarchy = createClusterHierarchy(dualTreeMST);
7271
var condenseStep = new CondenseStep(nodeCount);
7372
var condensedTree = condenseStep.condense(clusterHierarchy, minClusterSize);
7473
var labellingStep = new LabellingStep(condensedTree, nodeCount);
75-
return labellingStep.label();
74+
return labellingStep.labels();
7675
}
7776

7877
CoreResult computeCores(KdTree kdTree, long nodeCount) {
@@ -81,7 +80,7 @@ CoreResult computeCores(KdTree kdTree, long nodeCount) {
8180
ParallelUtil.parallelForEachNode(
8281
nodeCount, concurrency, terminationFlag,
8382
(nodeId) -> {
84-
neighbours.set(nodeId, kdTree.neighbours(nodeId, k));
83+
neighbours.set(nodeId, kdTree.neighbours(nodeId, samples));
8584
}
8685
);
8786

algo/src/main/java/org/neo4j/gds/hdbscan/LabellingStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ HugeLongArray computeLabels(BitSet selectedClusters) {
116116
return nodeCountLabels;
117117
}
118118

119-
HugeLongArray label() {
119+
HugeLongArray labels() {
120120
var stabilities = computeStabilities();
121121
var selectedClusters = selectedClusters(stabilities);
122122
return computeLabels(selectedClusters);

0 commit comments

Comments
 (0)