From 22067ae62a23af712d3081d981ae08756e6c071e Mon Sep 17 00:00:00 2001 From: Sebastian Vidrio Date: Mon, 26 Jan 2015 19:39:54 -0800 Subject: [PATCH] Test changes, adding destination_key --- h2o-r/h2o-package/R/constants.R | 1 + h2o-r/h2o-package/R/deeplearning.R | 2 +- h2o-r/h2o-package/R/gbm.R | 2 +- ...imbalance_large.R => runit_deeplearning_imbalance_large.R} | 4 ++-- .../testdir_algos/glm/runit_NOPASS_GLM_link_functions_gamma.R | 2 +- h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_prostate.R | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) rename h2o-r/tests/testdir_algos/deeplearning/{runit_deeplearning__NOPASS_imbalance_large.R => runit_deeplearning_imbalance_large.R} (84%) diff --git a/h2o-r/h2o-package/R/constants.R b/h2o-r/h2o-package/R/constants.R index 167e3fe1920b..513facf2a538 100755 --- a/h2o-r/h2o-package/R/constants.R +++ b/h2o-r/h2o-package/R/constants.R @@ -156,6 +156,7 @@ assign("LOG_FILE_NAME", NULL, .pkg.env) data.frame(type = "H2OFrame", scalar = TRUE, row.names = "Key", stringsAsFactors = FALSE), data.frame(type = "H2OFrame", scalar = TRUE, row.names = "Key", stringsAsFactors = FALSE), data.frame(type = "character", scalar = TRUE, row.names = "Key", stringsAsFactors = FALSE), + data.frame(type = "character", scalar = TRUE, row.names = "Key", stringsAsFactors = FALSE), data.frame(type = "numeric", scalar = TRUE, row.names = "int", stringsAsFactors = FALSE), data.frame(type = "numeric", scalar = FALSE, row.names = "int[]", stringsAsFactors = FALSE), data.frame(type = "numeric", scalar = TRUE, row.names = "long", stringsAsFactors = FALSE), diff --git a/h2o-r/h2o-package/R/deeplearning.R b/h2o-r/h2o-package/R/deeplearning.R index 50973cfde770..a75ee892c78e 100755 --- a/h2o-r/h2o-package/R/deeplearning.R +++ b/h2o-r/h2o-package/R/deeplearning.R @@ -68,7 +68,7 @@ #' dep <- names(iris.hex)[5] #' iris.dl <- h2o.deeplearning(x = indep, y = dep, data = iris.hex, activation = "Tanh", epochs = 5) -h2o.deeplearning <- function(x, y, training_frame, key = "", +h2o.deeplearning <- function(x, y, training_frame, destination_key = "", override_with_best_model, do_classification = TRUE, n_folds = 0, diff --git a/h2o-r/h2o-package/R/gbm.R b/h2o-r/h2o-package/R/gbm.R index 7a9762a69550..c29749296918 100755 --- a/h2o-r/h2o-package/R/gbm.R +++ b/h2o-r/h2o-package/R/gbm.R @@ -42,7 +42,7 @@ #' max_depth = 3, min_rows = 2) h2o.gbm <- function(x, y, training_frame, do_classification, ..., #AUTOGENERATED params - key, + destination_key, loss = c("AUTO", "bernoulli", "multinomial", "gaussian"), ntrees = 50, max_depth = 5, diff --git a/h2o-r/tests/testdir_algos/deeplearning/runit_deeplearning__NOPASS_imbalance_large.R b/h2o-r/tests/testdir_algos/deeplearning/runit_deeplearning_imbalance_large.R similarity index 84% rename from h2o-r/tests/testdir_algos/deeplearning/runit_deeplearning__NOPASS_imbalance_large.R rename to h2o-r/tests/testdir_algos/deeplearning/runit_deeplearning_imbalance_large.R index 4312bfeb8e20..1a53b9aff4ed 100644 --- a/h2o-r/tests/testdir_algos/deeplearning/runit_deeplearning__NOPASS_imbalance_large.R +++ b/h2o-r/tests/testdir_algos/deeplearning/runit_deeplearning_imbalance_large.R @@ -5,9 +5,9 @@ check.deeplearning_imbalanced <- function(conn) { Log.info("Test checks if Deep Learning works fine with an imbalanced dataset") covtype <- h2o.uploadFile(conn, locate("smalldata/covtype/covtype.20k.data")) - hh_imbalanced<-h2o.deeplearning(x=c(1:54),y=55,l1=1e-5,activation="Rectifier",hidden=c(200,200,200),epochs=5,training_frame=covtype,balance_classes=F, do_classification = TRUE) + hh_imbalanced<-h2o.deeplearning(x=c(1:54),y=55,l1=1e-5,activation="Rectifier",loss="CrossEntropy",hidden=c(200,200,200),epochs=5,training_frame=covtype,balance_classes=F, do_classification = TRUE) print(hh_imbalanced) - hh_balanced<-h2o.deeplearning(x=c(1:54),y=55,l1=1e-5,activation="Rectifier",hidden=c(200,200,200),epochs=5,training_frame=covtype,balance_classes=T, do_classification = TRUE) + hh_balanced<-h2o.deeplearning(x=c(1:54),y=55,l1=1e-5,activation="Rectifier",loss="CrossEntropy",hidden=c(200,200,200),epochs=5,training_frame=covtype,balance_classes=T, do_classification = TRUE) print(hh_balanced) #compare error for class 6 (difficult minority) diff --git a/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_link_functions_gamma.R b/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_link_functions_gamma.R index 2b26af535bd8..35bf79236cdf 100644 --- a/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_link_functions_gamma.R +++ b/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_link_functions_gamma.R @@ -51,7 +51,7 @@ test.linkFunctions <- function(conn) { } print("Create models with link: IDENTITY") - model.h2o.gamma.identity <- h2o.glm(x=myX, y=myY, data=h2o.data, family="gamma", link="identity",alpha=0.5, lambda=0, nfolds=0) + model.h2o.gamma.identity <- h2o.glm(x=myX, y=myY, training_frame=h2o.data, family="gamma", link="identity",alpha=0.5, lambda=0, nfolds=0) model.R.gamma.identity <- glm(formula=R.formula, data=R.data[,c(1:5,7:9)], family=Gamma(link=identity), na.action=na.omit) print("Compare model deviances for link function identity") diff --git a/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_prostate.R b/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_prostate.R index ca9f10bfc689..87874ee81476 100644 --- a/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_prostate.R +++ b/h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_prostate.R @@ -17,7 +17,7 @@ test.GLM.prostate <- function(conn) { # myX = paste(myX, collapse=",") Log.info(cat("B)H2O GLM (binomial) with parameters:\nX:", myX, "\nY:", myY, "\n")) - prostate.glm.h2o = h2o.glm(y = myY, x = myX, training_frame = prostate.hex, family = "binomial", nfolds = 10, alpha = 0.5) + prostate.glm.h2o = h2o.glm(y = myY, x = myX, training_frame = prostate.hex, family = "binomial", n_folds = 10, alpha = 0.5) print(prostate.glm.h2o) # prostate.glm = glm.fit(y = prostate.data[,myY], x = prostate.data[,myX], family = binomial)