You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by "Edward J. Yoon" <ed...@apache.org> on 2011/06/24 05:57:50 UTC

Fwd: A bug in the PageRank example

Just FYI,

As mentioned below, hard-coded default value for alpha (0.15) should
be replaced.

---------- Forwarded message ----------
From: Yunkai Zhang <be...@gmail.com>
Date: Fri, Jun 24, 2011 at 9:51 AM
Subject: A bug in the PageRank example
To: hama-user@incubator.apache.org


Hi,

I am playing with the pagerank example from trunk and found there is a bug
in the code.
If I assign any value other than 0.85 to the damping factor, the results
won't sum to 1.

For example: Set damping factor to *0.5*

11/06/23 17:28:05 INFO graph.PageRankBase: -------------------- RESULTS
--------------------
11/06/23 17:28:06 INFO graph.PageRankBase: stackoverflow.com |
0.052213531500120945
11/06/23 17:28:06 INFO graph.PageRankBase: nasa.gov | 0.04235399497763073
11/06/23 17:28:06 INFO graph.PageRankBase: facebook.com |
0.030321424044325564
11/06/23 17:28:06 INFO graph.PageRankBase: yahoo.com | 0.05650175656380897
11/06/23 17:28:07 INFO graph.PageRankBase: youtube.com |
0.025716796492259456
11/06/23 17:28:07 INFO graph.PageRankBase: google.com | 0.07350857237752877
11/06/23 17:28:07 INFO graph.PageRankBase: twitter.com |
0.030321424044325564

The sum is 0.3ish.

Therefore, I read the code. I think a possible reason is that the value of *
ALPHA* is hard-coded. (Formula: P(i) = ALPHA + 0.85 * sum, ALPHA = 0.15 /
NumVertices() )
In PageRank.java, line 167: ALPHA = *0.15* / (double) numOfVertices;

I think 0.15 should be replaced by (1 - DAMPING_FACTOR).



Thanks!



Best,
Benny



-- 
Best Regards, Edward J. Yoon
@eddieyoon

Re: A bug in the PageRank example

Posted by Thomas Jungblut <th...@googlemail.com>.
Yeah he is right, we should modify this.
I always wondered where this 0.15 came from. Thank you very much :)

2011/6/24 Edward J. Yoon <ed...@apache.org>

> Just FYI,
>
> As mentioned below, hard-coded default value for alpha (0.15) should
> be replaced.
>
> ---------- Forwarded message ----------
> From: Yunkai Zhang <be...@gmail.com>
> Date: Fri, Jun 24, 2011 at 9:51 AM
> Subject: A bug in the PageRank example
> To: hama-user@incubator.apache.org
>
>
> Hi,
>
> I am playing with the pagerank example from trunk and found there is a bug
> in the code.
> If I assign any value other than 0.85 to the damping factor, the results
> won't sum to 1.
>
> For example: Set damping factor to *0.5*
>
> 11/06/23 17:28:05 INFO graph.PageRankBase: -------------------- RESULTS
> --------------------
> 11/06/23 17:28:06 INFO graph.PageRankBase: stackoverflow.com |
> 0.052213531500120945
> 11/06/23 17:28:06 INFO graph.PageRankBase: nasa.gov | 0.04235399497763073
> 11/06/23 17:28:06 INFO graph.PageRankBase: facebook.com |
> 0.030321424044325564
> 11/06/23 17:28:06 INFO graph.PageRankBase: yahoo.com | 0.05650175656380897
> 11/06/23 17:28:07 INFO graph.PageRankBase: youtube.com |
> 0.025716796492259456
> 11/06/23 17:28:07 INFO graph.PageRankBase: google.com |
> 0.07350857237752877
> 11/06/23 17:28:07 INFO graph.PageRankBase: twitter.com |
> 0.030321424044325564
>
> The sum is 0.3ish.
>
> Therefore, I read the code. I think a possible reason is that the value of
> *
> ALPHA* is hard-coded. (Formula: P(i) = ALPHA + 0.85 * sum, ALPHA = 0.15 /
> NumVertices() )
> In PageRank.java, line 167: ALPHA = *0.15* / (double) numOfVertices;
>
> I think 0.15 should be replaced by (1 - DAMPING_FACTOR).
>
>
>
> Thanks!
>
>
>
> Best,
> Benny
>
>
>
> --
> Best Regards, Edward J. Yoon
> @eddieyoon
>



-- 
Thomas Jungblut
Berlin

mobile: 0170-3081070

business: thomas.jungblut@testberichte.de
private: thomas.jungblut@gmail.com