You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Base class for Filtered K-Nearest Neighbors endpoints."""
19
-
20
18
@abstractmethod
21
19
defmutate(
22
20
self,
@@ -44,7 +42,65 @@ def mutate(
44
42
concurrency: Any|None=None,
45
43
job_id: Any|None=None,
46
44
) ->KnnMutateResult:
47
-
"""Run filtered K-Nearest Neighbors in mutate mode."""
45
+
"""
46
+
Runs the Filtered K-Nearest Neighbors algorithm and stores the results as new relationships in the graph catalog.
47
+
48
+
The Filtered K-Nearest Neighbors algorithm computes a distance value for node pairs in the graph with customizable source and target node filters, creating new relationships between each node and its k nearest neighbors within the filtered subset.
49
+
50
+
Parameters
51
+
----------
52
+
G : GraphV2
53
+
The graph to run the algorithm on
54
+
mutate_relationship_type : str
55
+
The relationship type to use for the new relationships.
56
+
mutate_property : str
57
+
The relationship property to store the similarity score in.
"""Run filtered K-Nearest Neighbors in stats mode."""
131
+
"""
132
+
Runs the Filtered K-Nearest Neighbors algorithm and returns execution statistics.
133
+
134
+
The Filtered K-Nearest Neighbors algorithm computes a distance value for node pairs in the graph with customizable source and target node filters, creating new relationships between each node and its k nearest neighbors within the filtered subset.
Object containing execution statistics and algorithm-specific results.
185
+
"""
76
186
...
77
187
78
188
@abstractmethod
@@ -100,7 +210,61 @@ def stream(
100
210
concurrency: Any|None=None,
101
211
job_id: Any|None=None,
102
212
) ->DataFrame:
103
-
"""Run filtered K-Nearest Neighbors in stream mode."""
213
+
"""
214
+
Runs the Filtered K-Nearest Neighbors algorithm and returns the result as a DataFrame.
215
+
216
+
The Filtered K-Nearest Neighbors algorithm computes a distance value for node pairs in the graph with customizable source and target node filters, creating new relationships between each node and its k nearest neighbors within the filtered subset.
The similarity results as a DataFrame with columns 'node1', 'node2', and 'similarity'.
267
+
"""
104
268
...
105
269
106
270
@abstractmethod
@@ -132,7 +296,69 @@ def write(
132
296
concurrency: Any|None=None,
133
297
job_id: Any|None=None,
134
298
) ->KnnWriteResult:
135
-
"""Run filtered K-Nearest Neighbors in write mode."""
299
+
"""
300
+
Runs the Filtered K-Nearest Neighbors algorithm and writes the results back to the database.
301
+
302
+
The Filtered K-Nearest Neighbors algorithm computes a distance value for node pairs in the graph with customizable source and target node filters, creating new relationships between each node and its k nearest neighbors within the filtered subset.
303
+
304
+
Parameters
305
+
----------
306
+
G : GraphV2
307
+
The graph to run the algorithm on
308
+
write_relationship_type : str
309
+
The relationship type to use for the new relationships.
310
+
write_property : str
311
+
The relationship property to store the similarity score in.
Estimates the memory requirements for running the Filtered K-Nearest Neighbors algorithm.
389
+
390
+
The Filtered K-Nearest Neighbors algorithm computes a distance value for node pairs in the graph with customizable source and target node filters, creating new relationships between each node and its k nearest neighbors within the filtered subset.
Copy file name to clipboardExpand all lines: graphdatascience/tests/integrationV2/procedure_surface/arrow/similarity/test_knn_filtered_arrow_endpoints.py
0 commit comments