Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something wrong with random walk in node2vec_spark? #41

Open
rainbow2301 opened this issue May 25, 2018 · 2 comments
Open

something wrong with random walk in node2vec_spark? #41

rainbow2301 opened this issue May 25, 2018 · 2 comments

Comments

@rainbow2301
Copy link

val edge2attr = graph.triplets.map { edgeTriplet =>
(s"${edgeTriplet.srcId}${edgeTriplet.dstId}", edgeTriplet.attr)
}.repartition(200).cache

(s"${prevNodeId}${currentNodeId}", (srcNodeId, pathBuffer))
}.join(edge2attr).map { case (edge, ((srcNodeId, pathBuffer), attr)) =>

in the code, join key is generated by s"${edgeTriplet.srcId}${edgeTriplet.dstId}",
do we need a separator between the two elements?

@wl142857
Copy link

wl142857 commented Mar 5, 2019

Actually Yes. You should use s"${edgeTriplet.srcId}\t${edgeTriplet.dstId}" instead!

@liliangjie91
Copy link

liliangjie91 commented Dec 16, 2019

yes.
if you dont add a separator, edge between node #1 and node #1111 will be same with edge between node #11 and node #111 which is '11111'. When using sepaeator,like \t,there will be 1\t1111 vs 11\t111.

And ,i think, thats why u got bad results when your data is very big. Becase the bigger data you use,the more chance you get Wrong edges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants