[codeface] [PATCH 7/7] Remove hack to fix page rank numerical stability issues

  • From: Mitchell Joblin <joblin.m@xxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Thu, 21 Aug 2014 22:52:37 +0200

- It seems that there are no issues with the page rank
  analysis anymore

- The implementation of the old fix anyway looks to have a
  bug where the max iterations is never reached because i is
  never incremented

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
 codeface/R/cluster/persons.r          |  1 -
 codeface/R/cluster/vis.r              |  1 -
 codeface/R/ml/batch.r                 |  1 -
 codeface/R/page.rank.r                | 63 -----------------------------------
 codeface/R/shiny/apps/common.server.r |  1 -
 5 files changed, 67 deletions(-)
 delete mode 100644 codeface/R/page.rank.r

diff --git a/codeface/R/cluster/persons.r b/codeface/R/cluster/persons.r
index 6178a93..2d911d2 100755
--- a/codeface/R/cluster/persons.r
+++ b/codeface/R/cluster/persons.r
@@ -47,7 +47,6 @@ source("../utils.r", chdir=TRUE)
 source("../config.r", chdir=TRUE)
 source("../db.r", chdir=TRUE)
 source("../query.r", chdir=TRUE)
-source("../page.rank.r", chdir=TRUE)
 source("community_metrics.r")
 source("network_visualization.r")
 
diff --git a/codeface/R/cluster/vis.r b/codeface/R/cluster/vis.r
index 74b7538..0dfced3 100644
--- a/codeface/R/cluster/vis.r
+++ b/codeface/R/cluster/vis.r
@@ -35,7 +35,6 @@ source("../db.r", chdir=TRUE)
 source("../utils.r", chdir=TRUE)
 source("../query.r", chdir=TRUE)
 source("../commits.r", chdir=TRUE)
-source("../page.rank.r", chdir=TRUE)
 
 ## Global variables
 conf <- load.global.config("codeface.conf")
diff --git a/codeface/R/ml/batch.r b/codeface/R/ml/batch.r
index 87d8453..13be692 100755
--- a/codeface/R/ml/batch.r
+++ b/codeface/R/ml/batch.r
@@ -42,7 +42,6 @@ s(library(optparse))
 s(library(xtable))
 s(library(reshape))
 s(library(plyr))
-source("../page.rank.r", chdir=TRUE)
 rm(s)
 
 ## TODO: Filter out spam. There's an incredible amount in some gmane archives
diff --git a/codeface/R/page.rank.r b/codeface/R/page.rank.r
deleted file mode 100644
index 656ef9a..0000000
--- a/codeface/R/page.rank.r
+++ /dev/null
@@ -1,63 +0,0 @@
-## This file is part of Codeface. Codeface is free software: you can
-## redistribute it and/or modify it under the terms of the GNU General Public
-## License as published by the Free Software Foundation, version 2.
-##
-## This program is distributed in the hope that it will be useful, but WITHOUT
-## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS
-## FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-## details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-##
-## Copyright 2010, 2011 by Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx>
-## Copyright 2012, 2013, Siemens AG, Wolfgang Mauerer 
<wolfgang.mauerer@xxxxxxxxxxx>
-## All Rights Reserved.
-
-## NOTE: This file needs to be sourced _after_ the igraph
-## library has been loaded
-
-## Hacky fix for problems with page rank that are (presumably) caused by
-## problems in the FORTRAN implementation of igraphdneupd (error 1: Schur form
-## computed by LAPACK routine dlahqr). Once this is properly fixed in the
-## FORTRAN code, this work-around needs to go away.
-## TODO: Acutally, I'm not sure if copying the graph for each try or re-setting
-## the RNG is respoinsible for the "fix".
-
-page.rank.orig <- page.rank
-
-MAX.RETRIES <- 10
-page.rank <- function(g, ...) {
-  success <- FALSE
-  res <- NULL
-  i <- 1
-
-  repeat {
-    tryCatch({
-      g.work <- g
-      res <- page.rank.orig(g.work, ...)
-      success <- TRUE
-    }, error=function(e) {
-      logwarning("Numerical problems with page.rank encountered, trying to fix 
up",
-                 logger="page.rank")      
-    })
-
-    if (success) {
-      break
-    } else {
-      ## Try with a different random seed
-      i <- 1 + 1
-      set.seed(i)
-    }
-
-    if (i >= MAX.RETRIES) {
-      break
-    }
-  }
-
-  if (is.null(res)) {
-    stop("Internal error: Fix for page.rank failed!")
-  }
-  return(res)
-}
diff --git a/codeface/R/shiny/apps/common.server.r 
b/codeface/R/shiny/apps/common.server.r
index 1462a3e..7f6b12e 100644
--- a/codeface/R/shiny/apps/common.server.r
+++ b/codeface/R/shiny/apps/common.server.r
@@ -28,7 +28,6 @@ source("../../utils.r", chdir=TRUE)
 source("../../query.r", chdir=TRUE)
 source("../../commits.r", chdir=TRUE)
 source("../../vis.ports.r", chdir=TRUE)
-source("../../page.rank.r", chdir=TRUE)
 
 ## Global variables
 conf <- config.from.args(require.project=FALSE)
-- 
1.9.1


Other related posts:

  • » [codeface] [PATCH 7/7] Remove hack to fix page rank numerical stability issues - Mitchell Joblin