1
+ // Node Embeddings 1d using Fast Random Projection: Stream for Hyper-Parameter tuning. Requires "Add_file_name and_extension.cypher".
2
+
3
+ CALL gds .fastRP .stream (
4
+ $dependencies_projection + '-cleaned' , {
5
+ embeddingDimension : toInteger ($dependencies_projection_embedding_dimension )
6
+ , randomSeed : toInteger ($dependencies_projection_embedding_random_seed )
7
+ , normalizationStrength : toFloat ($dependencies_projection_fast_random_projection_normalization_strength )
8
+ , iterationWeights : [0.0 , 0.0 , 1.0 , toFloat ($dependencies_projection_fast_random_projection_forth_iteration_weight )]
9
+ , relationshipWeightProperty : $dependencies_projection_weight_property
10
+ }
11
+ )
12
+ YIELD nodeId , embedding
13
+ WITH gds .util .asNode (nodeId ) AS codeUnit
14
+ ,embedding
15
+ OPTIONAL MATCH (artifact :Java :Artifact )- [ : CONTAINS ] -> (codeUnit )
16
+ WITH * , artifact .name AS artifactName
17
+ OPTIONAL MATCH (projectRoot :Directory )<- [ : HAS_ROOT ] - (proj :TS :Project )- [ : CONTAINS ] -> (codeUnit )
18
+ WITH * , last (split (projectRoot .absoluteFileName , '/' )) AS projectName
19
+ RETURN DISTINCT
20
+ coalesce (codeUnit .fqn , codeUnit .globalFqn , codeUnit .fileName , codeUnit .signature , codeUnit .name ) AS codeUnitName
21
+ ,codeUnit .name AS shortCodeUnitName
22
+ ,elementId (codeUnit ) AS nodeElementId
23
+ ,coalesce (artifactName , projectName ) AS projectName
24
+ ,coalesce (codeUnit .communityLeidenId , 0 ) AS communityId
25
+ ,coalesce (codeUnit .centralityPageRank , 0.01 ) AS centrality
26
+ ,embedding
0 commit comments