RandomWalkSample Example - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

citvertices_2
id
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1013
1014
1015
1016
1017
1018
1019
1020
...
citedges_2
from_id to_id
1057 1003
1076 1046
1080 1035
1110 1092
1129 1101
1134 1001
1134 1054
1152 4015
1155 1046
1160 1005
1161 1080
1161 1035
1172 4210
1178 1177
1195 1046
1196 1119
1204 1073
1209 1189
1222 3283
1225 1072
... ....

Call

Specifying the Seed value in the SQL-GR call guarantees that the result is repeatable on the same cluster. However, the result can differ between clusters, as the sample graph is not deterministic.

SELECT * FROM RandomWalkSample (
  ON citvertices_2 AS vertices PARTITION BY id
  ON citedges_2 AS edges PARTITION BY from_id
  OUT TABLE VertexOutputTable (rw_vertices_15)
  OUT TABLE EdgeOutputTable (rw_edges_15)
  USING
  TargetKey ('to_id')
  FlyBackRate (0.15)
  SampleRate (0.15)
  Seed (1000)
) AS dt;

Output

Output Summary
name count
vertices 1209
edges 744
sampled vertices 181
sampled edges 107
Output Table (sampled vertices)
id
1002
1005
1011
1015
1022
1037
1043
1046
1075
1076
1083
1086
1095
...
edges
source target
3283 1022
4179 1086
1243 3209
3161 1101
3149 3055
3219 3149
3149 3160
2063 2064
4179 3033
3209 1123
3277 3028
1195 1046
3161 2147
... ...