Skip to content

Instantly share code, notes, and snippets.

@ledell
Created October 11, 2015 03:32
Show Gist options
  • Save ledell/472740dc9c9e8352eafa to your computer and use it in GitHub Desktop.
Save ledell/472740dc9c9e8352eafa to your computer and use it in GitHub Desktop.
# install.packages("h2o", type="source", repos=(c("http://h2o-release.s3.amazonaws.com/h2o/rel-slater/5/R")))
library(h2o)
localH2O <- h2o.init(ip = "XX.XX.XX.XX", port = 54321)
#higgs <- h2o.importFile("/home/0xdiag/datasets/higgs/HIGGS.csv", destination_frame = "higgs") #Local copy
higgs <- h2o.importFile("http://archive.ics.uci.edu/ml/machine-learning-databases/00280/HIGGS.csv.gz", destination_frame = "higgs")
dim(higgs) #11M x 29
higgs$C1 <- as.factor(higgs$C1) #Encode response as categorical
split <- h2o.splitFrame(data = higgs, ratios = 0.7)
train <- split[[1]]
test <- split[[2]]
dim(train)
dim(test)
y <- "C1"
x <- setdiff(names(train), y)
fit1 <- h2o.glm(x = x, y = y,
training_frame = train,
validation_frame = test,
family = "binomial")
h2o.auc(fit1, valid = TRUE) #AUC = 0.684434
fit2 <- h2o.deeplearning(x = x, y = y,
training_frame = train,
validation_frame = test,
distribution = "bernoulli")
h2o.auc(fit2, valid = TRUE) #AUC = 0.837863
@vishwajitsen
Copy link

Hello how are you? I am trying to run the exact same code mentioned above but getting an error 2: priorDistribution output field is no longer supported
3: In .dep.model(m) : classification is no longer a supported output field.. Please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment