Skip to content

Commit b592077

Browse files
committed
Add stats and estimation examples to Node Similarity Docs
1 parent 01436f1 commit b592077

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

doc/asciidoc/algorithms/node-similarity.adoc

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ This topic includes:
2020
*** <<algorithms-node-similarity-examples-limits-topk-bottomk, topK and bottomK>>
2121
*** <<algorithms-node-similarity-examples-limits-topn-bottomn, topN and bottomN>>
2222
** <<algorithms-node-similarity-examples-degree-similarity-cutoff, Degree cutoff and similarity cutoff>>
23-
23+
** <<algorithms-node-similarity-examples-memory-estimation, Memory Estimation>>
24+
** <<algorithms-node-similarity-examples-stats, Stats>>
2425

2526
[[algorithms-node-similarity-intro]]
2627
== Introduction
@@ -589,3 +590,47 @@ ORDER BY Person1
589590
3+|6 rows
590591
|===
591592
--
593+
594+
595+
[[algorithms-node-similarity-examples-memory-estimation]]
596+
=== Memory Estimation
597+
598+
[role=query-example]
599+
--
600+
.The following will estimate the memory requirements for running the algorithm:
601+
[source, cypher]
602+
----
603+
CALL gds.nodeSimilarity.write.estimate('myGraph', {
604+
writeRelationshipType: 'SIMILAR',
605+
writeProperty: 'score'
606+
})
607+
YIELD nodeCount, relationshipCount, bytesMin, bytesMax, requiredMemory
608+
----
609+
610+
.Results
611+
[opts="header", cols="1,1,1,1,1"]
612+
|===
613+
| nodeCount | relationshipCount | bytesMin | bytesMax | requiredMemory
614+
| 9 | 18 | 2640 | 2640 | "2640 Bytes"
615+
|===
616+
--
617+
618+
[[algorithms-node-similarity-examples-stats]]
619+
=== Stats
620+
621+
[role=query-example]
622+
--
623+
.The following will run the algorithm and returns the result in form of statistical and measurement values
624+
[source, cypher]
625+
----
626+
CALL gds.nodeSimilarity.stats('myGraph')
627+
YIELD nodesCompared
628+
----
629+
630+
.Results
631+
[opts="header",cols="1"]
632+
|===
633+
| nodesCompared
634+
| 4
635+
|===
636+
--

doc/src/test/java/org/neo4j/graphalgo/doc/NodeSimilarityDocTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.neo4j.graphalgo.doc;
2121

2222
import org.neo4j.graphalgo.catalog.GraphCreateProc;
23+
import org.neo4j.graphalgo.nodesim.NodeSimilarityStatsProc;
2324
import org.neo4j.graphalgo.nodesim.NodeSimilarityStreamProc;
2425
import org.neo4j.graphalgo.nodesim.NodeSimilarityWriteProc;
2526

@@ -30,7 +31,12 @@ class NodeSimilarityDocTest extends DocTestBase {
3031

3132
@Override
3233
List<Class<?>> procedures() {
33-
return Arrays.asList(NodeSimilarityStreamProc.class, NodeSimilarityWriteProc.class, GraphCreateProc.class);
34+
return Arrays.asList(
35+
NodeSimilarityStreamProc.class,
36+
NodeSimilarityWriteProc.class,
37+
NodeSimilarityStatsProc.class,
38+
GraphCreateProc.class
39+
);
3440
}
3541

3642
@Override

0 commit comments

Comments
 (0)