Skip to content

Commit 7996606

Browse files
committed
Make LP predict return sane root progress
1 parent da96a17 commit 7996606

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ ExhaustiveLinkPredictionResult predictLinks(
7676
Graph graph,
7777
LinkPredictionSimilarityComputer linkPredictionSimilarityComputer
7878
) {
79+
progressTracker.setSteps(graph.nodeCount());
80+
7981
var predictionQueue = BoundedLongLongPriorityQueue.max(topN);
8082

8183
var tasks = PartitionUtils.rangePartition(
@@ -139,7 +141,7 @@ public void run() {
139141
);
140142
});
141143

142-
progressTracker.logProgress(partition.nodeCount());
144+
progressTracker.logSteps(partition.nodeCount());
143145
}
144146

145147
private LongHashSet largerNeighbors(long sourceId) {

proc/machine-learning/src/main/java/org/neo4j/gds/ml/linkmodels/pipeline/predict/LinkPredictionPredictPipelineExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ public static Task progressTask(
102102
taskName,
103103
Tasks.iterativeFixed(
104104
"Execute node property steps",
105-
() -> List.of(Tasks.leaf("Step")),
105+
() -> List.of(Tasks.leaf("Step", 10 * graphStore.getUnion().relationshipCount())),
106106
pipeline.nodePropertySteps().size()
107107
),
108108
config.isApproximateStrategy()
109109
? Tasks.task(
110110
"Approximate link prediction",
111111
KnnFactory.knnTaskTree(graphStore.getUnion(), config.approximateConfig())
112112
)
113-
: Tasks.leaf("Exhaustive link prediction", graphStore.nodeCount())
113+
: Tasks.leaf("Exhaustive link prediction", graphStore.getUnion().nodeCount() * graphStore.getUnion().nodeCount() / 2)
114114
);
115115
}
116116

0 commit comments

Comments
 (0)