|
10 | 10 | from graphdatascience.procedure_surface.api.estimation_result import EstimationResult |
11 | 11 |
|
12 | 12 |
|
13 | | -class KnnMutateResult(BaseResult): |
14 | | - """Represents the result of running K-Nearest Neighbors in mutate mode.""" |
15 | | - |
16 | | - pre_processing_millis: int |
17 | | - compute_millis: int |
18 | | - mutate_millis: int |
19 | | - post_processing_millis: int |
20 | | - nodes_compared: int |
21 | | - relationships_written: int |
22 | | - similarity_distribution: dict[str, Any] |
23 | | - did_converge: bool |
24 | | - ran_iterations: int |
25 | | - node_pairs_considered: int |
26 | | - configuration: dict[str, Any] |
27 | | - |
28 | | - |
29 | | -class KnnStatsResult(BaseResult): |
30 | | - """Represents the result of running K-Nearest Neighbors in stats mode.""" |
31 | | - |
32 | | - pre_processing_millis: int |
33 | | - compute_millis: int |
34 | | - post_processing_millis: int |
35 | | - nodes_compared: int |
36 | | - similarity_pairs: int |
37 | | - similarity_distribution: dict[str, Any] |
38 | | - did_converge: bool |
39 | | - ran_iterations: int |
40 | | - node_pairs_considered: int |
41 | | - configuration: dict[str, Any] |
42 | | - |
43 | | - |
44 | | -class KnnWriteResult(BaseResult): |
45 | | - """Represents the result of running K-Nearest Neighbors in write mode.""" |
46 | | - |
47 | | - pre_processing_millis: int |
48 | | - compute_millis: int |
49 | | - write_millis: int |
50 | | - post_processing_millis: int |
51 | | - nodes_compared: int |
52 | | - relationships_written: int |
53 | | - did_converge: bool |
54 | | - ran_iterations: int |
55 | | - node_pairs_considered: int |
56 | | - similarity_distribution: dict[str, Any] |
57 | | - configuration: dict[str, Any] |
58 | | - |
59 | | - |
60 | 13 | class KnnEndpoints(ABC): |
61 | 14 | @abstractmethod |
62 | 15 | def mutate( |
@@ -85,8 +38,6 @@ def mutate( |
85 | 38 | """ |
86 | 39 | Runs the K-Nearest Neighbors algorithm and stores the results as new relationships in the graph catalog. |
87 | 40 |
|
88 | | - The K-Nearest Neighbors algorithm computes a distance value for all node pairs in the graph and creates new relationships between each node and its k nearest neighbors |
89 | | -
|
90 | 41 | Parameters |
91 | 42 | ---------- |
92 | 43 | G : GraphV2 |
@@ -161,8 +112,6 @@ def stats( |
161 | 112 | """ |
162 | 113 | Runs the K-Nearest Neighbors algorithm and returns execution statistics. |
163 | 114 |
|
164 | | - The K-Nearest Neighbors algorithm computes a distance value for all node pairs in the graph and creates new relationships between each node and its k nearest neighbors |
165 | | -
|
166 | 115 | Parameters |
167 | 116 | ---------- |
168 | 117 | G : GraphV2 |
@@ -233,8 +182,6 @@ def stream( |
233 | 182 | """ |
234 | 183 | Runs the K-Nearest Neighbors algorithm and returns the result as a DataFrame. |
235 | 184 |
|
236 | | - The K-Nearest Neighbors algorithm computes a distance value for all node pairs in the graph and creates new relationships between each node and its k nearest neighbors |
237 | | -
|
238 | 185 | Parameters |
239 | 186 | ---------- |
240 | 187 | G : GraphV2 |
@@ -308,8 +255,6 @@ def write( |
308 | 255 | """ |
309 | 256 | Runs the K-Nearest Neighbors algorithm and writes the results back to the database. |
310 | 257 |
|
311 | | - The K-Nearest Neighbors algorithm computes a distance value for all node pairs in the graph and creates new relationships between each node and its k nearest neighbors |
312 | | -
|
313 | 258 | Parameters |
314 | 259 | ---------- |
315 | 260 | G : GraphV2 |
@@ -386,8 +331,6 @@ def estimate( |
386 | 331 | """ |
387 | 332 | Estimates the memory requirements for running the K-Nearest Neighbors algorithm. |
388 | 333 |
|
389 | | - The K-Nearest Neighbors algorithm computes a distance value for all node pairs in the graph and creates new relationships between each node and its k nearest neighbors |
390 | | -
|
391 | 334 | Parameters |
392 | 335 | ---------- |
393 | 336 | G : GraphV2 |
@@ -432,3 +375,44 @@ def estimate( |
432 | 375 | EstimationResult |
433 | 376 | Object containing the estimated memory requirements. |
434 | 377 | """ |
| 378 | + |
| 379 | + |
| 380 | +class KnnMutateResult(BaseResult): |
| 381 | + pre_processing_millis: int |
| 382 | + compute_millis: int |
| 383 | + mutate_millis: int |
| 384 | + post_processing_millis: int |
| 385 | + nodes_compared: int |
| 386 | + relationships_written: int |
| 387 | + similarity_distribution: dict[str, Any] |
| 388 | + did_converge: bool |
| 389 | + ran_iterations: int |
| 390 | + node_pairs_considered: int |
| 391 | + configuration: dict[str, Any] |
| 392 | + |
| 393 | + |
| 394 | +class KnnStatsResult(BaseResult): |
| 395 | + pre_processing_millis: int |
| 396 | + compute_millis: int |
| 397 | + post_processing_millis: int |
| 398 | + nodes_compared: int |
| 399 | + similarity_pairs: int |
| 400 | + similarity_distribution: dict[str, Any] |
| 401 | + did_converge: bool |
| 402 | + ran_iterations: int |
| 403 | + node_pairs_considered: int |
| 404 | + configuration: dict[str, Any] |
| 405 | + |
| 406 | + |
| 407 | +class KnnWriteResult(BaseResult): |
| 408 | + pre_processing_millis: int |
| 409 | + compute_millis: int |
| 410 | + write_millis: int |
| 411 | + post_processing_millis: int |
| 412 | + nodes_compared: int |
| 413 | + relationships_written: int |
| 414 | + did_converge: bool |
| 415 | + ran_iterations: int |
| 416 | + node_pairs_considered: int |
| 417 | + similarity_distribution: dict[str, Any] |
| 418 | + configuration: dict[str, Any] |
0 commit comments