Skip to content

Commit 1438cd7

Browse files
committed
Reduce minimum batch size in link prediction predict
1 parent 104b747 commit 1438cd7

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

alpha/alpha-proc/src/main/java/org/neo4j/gds/ml/linkmodels/pipeline/predict/ApproximateLinkPrediction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import java.util.stream.Stream;
4040

4141
public class ApproximateLinkPrediction extends LinkPrediction {
42+
static final int MIN_NODE_BATCH_SIZE = 10;
4243
private final KnnBaseConfig knnConfig;
4344

4445
public ApproximateLinkPrediction(

alpha/alpha-proc/src/main/java/org/neo4j/gds/ml/linkmodels/pipeline/predict/ExhaustiveLinkPrediction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.stream.LongStream;
3636

3737
public class ExhaustiveLinkPrediction extends LinkPrediction {
38+
private static final int MIN_NODE_BATCH_SIZE = 10;
3839
private final int topN;
3940
private final double threshold;
4041

@@ -75,7 +76,7 @@ ExhaustiveLinkPredictionResult predictLinks(
7576
partition,
7677
progressTracker
7778
),
78-
Optional.empty()
79+
Optional.of(MIN_NODE_BATCH_SIZE)
7980
);
8081

8182
ParallelUtil.runWithConcurrency(concurrency, tasks, Pools.DEFAULT);

alpha/alpha-proc/src/main/java/org/neo4j/gds/ml/linkmodels/pipeline/predict/LinkPredictionPredictPipelineBaseConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ default KnnBaseConfig approximateConfig() {
116116
var knnBuilder = ImmutableKnnBaseConfig.builder()
117117
.sampleRate(sampleRate())
118118
.nodeWeightProperty("NotUsedInLP")
119+
.minBatchSize(ApproximateLinkPrediction.MIN_NODE_BATCH_SIZE)
119120
.concurrency(concurrency());
120121

121122
topK().ifPresent(knnBuilder::topK);

0 commit comments

Comments
 (0)