Skip to content

Instantly share code, notes, and snippets.

@TomLous
Last active April 25, 2017 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomLous/5ac87182af917a825d62b903a5a80d31 to your computer and use it in GitHub Desktop.
Save TomLous/5ac87182af917a825d62b903a5a80d31 to your computer and use it in GitHub Desktop.
// edges are given the probabilty of the correctness of the edge
val edges: RDD[Edge[Double]] = predictedLinksDataset.rdd.map(
l => Edge(l.dossierNummer_left.toLong, l.dossierNummer_right.toLong, l.probability))
// vertices are just tuples of the dossiernummer.toLong (VertexId is typed as Long)
val vertices: RDD[(VertexId, KvKRecord)] = predictedLinksDataset.rdd.map(
k => (k.dossierNummer.toLong, k))
// the graph
val linkedGraph = Graph(vertices, edges)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment