Skip to content

Commit

Permalink
failing runit test for Cox for AIOO error for h2o.predict
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Wang committed May 4, 2015
1 parent 34cc860 commit 3a111f0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions R/tests/testdir_algos/coxph/runit_NOPASS_CoxPH_predict.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source('../../findNSourceUtils.R')

test.CoxPH.predict <- function(conn) {
Log.info("Import PBC from surivival package into H2O...")
pbc.hex <- as.h2o(conn, pbc, key = "pbc.hex")
Log.info("Create response and predictor features...")
pbc.hex$statusOf2 <- pbc.hex$status == 2
pbc.hex$logBili <- log(pbc.hex$bili)
pbc.hex$logProtime <- log(pbc.hex$protime)
pbc.hex$logAlbumin <- log(pbc.hex$albumin)
Log.info("Build Cox PH model with features including both numeric and factor types...")
pbcmodel <- h2o.coxph(x = c("age", "edema", "logBili", "logProtime", "logAlbumin", "sex"),
y = c("time", "statusOf2"), data = pbc.hex)

Log.info("Predict on the Cox PH model...")
pred <- h2o.predict(object = pbcmodel, newdata = pbc.hex)
#### Missing comparison against cox model in R. Input after AIOO error fixed for h2o.predict on Cox model.
testEnd()
}

doTest("Cox PH Model Test: Categorical Column", test.CoxPH.predict)

0 comments on commit 3a111f0

Please sign in to comment.