You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/02 06:06:51 UTC

[GitHub] [spark] shahidki31 commented on a change in pull request #24230: [SPARK-27295][GraphX] Provision to provide the initial scores for source nodes while running Personalized Page Rank

shahidki31 commented on a change in pull request #24230: [SPARK-27295][GraphX] Provision to provide the initial scores for source nodes while running Personalized Page Rank
URL: https://github.com/apache/spark/pull/24230#discussion_r271144876
 
 

 ##########
 File path: graphx/src/main/scala/org/apache/spark/graphx/lib/PageRank.scala
 ##########
 @@ -189,6 +189,33 @@ object PageRank extends Logging {
       numIter: Int,
       resetProb: Double = 0.15,
       sources: Array[VertexId]): Graph[Vector, Double] = {
+    val sourcesWithScores = sources.map((_, 1.0))
+    runParallelPersonalizedPageRank(graph, numIter, resetProb, sourcesWithScores)
+  }
+
+  /**
+   * Run Personalized PageRank for a fixed number of iterations, for a
+   * set of starting nodes in parallel. Returns a graph with vertex attributes
+   * containing the pagerank relative to all starting nodes (as a sparse vector) and
+   * edge attributes the normalized edge weight
+   *
+   * @tparam VD The original vertex attribute (not used)
+   * @tparam ED The original edge attribute (not used)
+   *
+   * @param graph The graph on which to compute personalized pagerank
+   * @param numIter The number of iterations to run
+   * @param resetProb The random reset probability
+   * @param sources The list of (source, initial score) to compute personalized pagerank from
+   * @return the graph with vertex attributes
+   *         containing the pagerank relative to all starting nodes (as a sparse vector
+   *         indexed by the position of nodes in the sources list) and
+   *         edge attributes the normalized edge weight
+   */
 
 Review comment:
   @since 3.0.0 ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org