forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Amy Wang
committed
May 4, 2015
1 parent
a34a783
commit 34cc860
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## | ||
# Test: ifelse is added as method for H2OParsedData properly | ||
# Description: push a dataset into H2O and convert column using ifelse | ||
## | ||
|
||
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) | ||
source('../findNSourceUtils.R') | ||
|
||
test.ifelse <- function(conn) { | ||
|
||
Log.info("Importing heart dataset into H2O...") | ||
heart.hex <- as.h2o(h, object = heart) | ||
Log.info("Change Surgery Column in R using bases' ifelse...") | ||
heart$surgery <- ifelse(heart$surgery == 0, "N", "Y") | ||
Log.info("Change Surgery Column in H2O using H2O's ifelse...") | ||
heart.hex$surgery <- ifelse(heart.hex$surgery == 0, "N", "Y") | ||
|
||
if(!all(heart$surgery == as.data.fram(heart.hex$surgery))) stop("Conversion of column different between h2o and base ifelse function!") | ||
|
||
testEnd() | ||
} | ||
|
||
doTest("R and H2O ifelse Function", test.ifelse) | ||
|