Skip to content

Commit 3c3a02d

Browse files
adamnschFlorentinD
andcommitted
Add docs around GDS sampling
Co-Authored-By: Florentin Dörre <[email protected]>
1 parent 0e9b9d1 commit 3c3a02d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/source/integration.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ The ``from_gds`` method takes two mandatory positional parameters:
105105
* An initialized ``GraphDataScience`` object for the connection to the GDS instance, and
106106
* A ``Graph`` representing the projection that one wants to import.
107107

108+
The optional ``max_node_count`` parameter can be used to limit the number of nodes that are imported from the
109+
projection.
110+
By default, it is set to 10.000, meaning that if the projection has more than 10.000 nodes, ``from_gds`` will sample
111+
from it using random walk with restarts, to get a smaller graph that can be visualized.
112+
If you want to have more control of the sampling, such as choosing a specific start node for the sample, you can call
113+
a `sampling <https://neo4j.com/docs/graph-data-science/current/management-ops/graph-creation/sampling/>`_
114+
method yourself and passing the resulting projection to ``from_gds``.
115+
108116
We can also provide an optional ``size_property`` parameter, which should refer to a node property of the projection,
109117
and will be used to determine the sizes of the nodes in the visualization.
110118

0 commit comments

Comments
 (0)