[Diagnosismed-list] Segfaults with ROC

Pete Meyer petemeyer at google.com
Sat Aug 1 00:01:09 CEST 2009


I downloaded DiagnosisMed and have been playing with the ROC function.  My
version info is:

> R.Version()
$platform
[1] "x86_64-unknown-linux-gnu"

$arch
[1] "x86_64"

$os
[1] "linux-gnu"

$system
[1] "x86_64, linux-gnu"

$status
[1] ""

$major
[1] "2"

$minor
[1] "9.0"

$year
[1] "2009"

$month
[1] "04"

$day
[1] "17"

$`svn rev`
[1] "48333"

$language
[1] "R"

$version.string
[1] "R version 2.9.0 (2009-04-17)"

I had perhaps a dozen segfaults and otherwise warnings everytime I ran it.
A typical complaint was:

diagnosismed-list at lists.r-forge.r-project.org *** caught segfault ***
address 0x100000011, cause 'memory not mapped'

Traceback:
 1: makeRestartList(...)
 2: withRestarts({    .Internal(.signalCondition(simpleWarning(msg, call),
msg,         call))    .Internal(.dfltWarn(msg, call))}, muffleWarning =
function() NULL)
 3: .signalSimpleWarning("longer object length is not a multiple of shorter
object length",     quote(Y >= Xi))
 4: FUN(X[[204L]], ...)
 5: lapply(split(X, group), FUN, ...)
 6: tapply(X, X, "D10X")
 7: ROC(gold = gold, test = test, Print = Print)
 8: roc.plot(AC.gold, frm$OldACDiff, label = "AdCreative - Current scale")

I took a look at the code where the problem was occurring:

    m <- length(X)
    n <- length(Y)
    D10X <- function(Xi) {
        (1/n) * sum(Y >= Xi)
    }
    D01Y <- function(Yi) {
        (1/m) * sum(Yi >= X)
    }
    VAR.AUC <- sum((tapply(X, X, "D10X") - AUC)^2)/(m * (m -
        1)) + sum((tapply(Y, Y, "D01Y") - AUC)^2)/(n * (n - 1))

It looks like the code should run, expanding the Yi to rep(Yi, m) and
likewise for Xi.  When I explicitly replaced those two statements with:

        (1/n) * sum(Y >= rep(Xi, n))

and

        (1/m) * sum(rep(Yi, m) >= X)

everything ran just fine.  Thought I'd let you know.  Thanks for making the
package available!

Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/diagnosismed-list/attachments/20090731/af015906/attachment.htm 


More information about the Diagnosismed-list mailing list