Skip to content

Commit

Permalink
Merge branch 'master' of github.com:0xdata/h2o into mm_fix_prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalohlava committed Feb 24, 2014
2 parents ac380f5 + 9f27904 commit 96549b7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 65 deletions.
1 change: 1 addition & 0 deletions R/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pdf
h2o-package/DESCRIPTION
h2o-package/man/h2o-package.Rd
h2o-package/h2o_package.pdf
h2o-package/inst/java
2 changes: 1 addition & 1 deletion R/h2o-DESCRIPTION.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ License: Apache License (== 2.0)
Depends: R (>= 2.13.0), RCurl, rjson, statmod, tools, methods, utils
Collate: Wrapper.R Internal.R Classes.R ParseImport.R Algorithms.R
NeedsCompilation: no
SystemRequirements: java
SystemRequirements: java 6 or newer
URL: http://www.0xdata.com
10 changes: 5 additions & 5 deletions R/h2o-package.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
H2O R Interface
}
\description{
This is a package for running H2O via its REST API from within R. To communicate with a H2O instance, the version of the R package must match the version of H2O, so when connecting to a new H2O cluster, it is necessary to re-run the initializer.
This is a package for running H2O via its REST API from within R. To communicate with a H2O instance, the version of the R package must match the version of H2O. When connecting to a new H2O cluster, it is necessary to re-run the initializer.
}
\details{
\tabular{ll}{
Expand All @@ -18,11 +18,11 @@ License: \tab Apache License (== 2.0)\cr
Depends: \tab R (>= 2.13.0), RCurl, rjson, statmod, tools, methods, utils\cr
}

This package allows the user to run basic H2O commands using R commands. In order to use it, you must first have H2O running (See \href{http://0xdata.com/h2o/docs/}{How to Start H2O}). To run H2O on your local machine, call \code{h2o.init} without any arguments, and H2O will be automatically launched on \url{http://127.0.0.1:54321}, where the IP is "127.0.0.1" and the port is 54321. If H2O is running on a cluster, you must provide the IP and port of the remote machine.
This package allows the user to run basic H2O commands using R commands. In order to use it, you must first have H2O running (See \href{http://docs.0xdata.com/newuser/quickstart_jar.html}{How to Start H2O}). To run H2O on your local machine, call \code{h2o.init} without any arguments, and H2O will be automatically launched on \url{http://127.0.0.1:54321}, where the IP is "127.0.0.1" and the port is 54321. If H2O is running on a cluster, you must provide the IP and port of the remote machine as arguments to the h2o.init() call.

H2O supports a number of standard statistical models, such as GLM, K-means, and random forest classification. For example, to run GLM, call \code{\link{h2o.glm}} with the parsed data and parameters (response variable, error distribution) as arguments. (The operation will be done on the server associated with the data object).
H2O supports a number of standard statistical models, such as GLM, K-means, and Random Forest classification. For example, to run GLM, call \code{\link{h2o.glm}} with the H2O parsed data and parameters (response variable, error distribution, etc...) as arguments. (The operation will be done on the server associated with the data object where H2O is running, not within the R environment).

Note that no actual data is stored in the workspace - R only saves the hex keys, which uniquely identify the data set, model, etc on the server. When the user makes a request, R queries the server via the REST API, which returns a JSON file with the relevant information that R then displays in the console.
Note that no actual data is stored in the R workspace; and no actual work is carried out by R. R only saves the named objects, which uniquely identify the data set, model, etc on the server. When the user makes a request, R queries the server via the REST API, which returns a JSON file with the relevant information that R then displays in the console.
}
\author{
Anqi Fu, Tom Kraljevic and Petr Maj, with contributions from the 0xdata team
Expand All @@ -45,7 +45,7 @@ library(h2o)
localH2O = h2o.init(ip = "127.0.0.1", port = 54321, startH2O = TRUE)

# Import iris dataset into H2O and print summary
irisPath = system.file("extdata", "iris.csv", package="h2o")
irisPath = system.file("extdata", "iris.csv", package = "h2o")
iris.hex = h2o.importFile(localH2O, path = irisPath, key = "iris.hex")
summary(iris.hex)

Expand Down
8 changes: 8 additions & 0 deletions R/h2o-package/R/Wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ h2o.init <- function(ip = "127.0.0.1", port = 54321, startH2O = TRUE, Xmx = "1g"
}
cat("Successfully connected to", myURL, "\n")
H2Oserver = new("H2OClient", ip = ip, port = port)
Sys.sleep(1) # Give cluster time to come up
h2o.clusterInfo(H2Oserver); cat("\n")

if((verH2O = .h2o.__version(H2Oserver)) != (verPkg = packageVersion("h2o")))
Expand Down Expand Up @@ -49,6 +50,13 @@ h2o.shutdown <- function(client, prompt = TRUE) {
}

# ----------------------- Diagnostics ----------------------- #


#****TODO: This isn't really a cluster status... it's a node status check for the node we're connected to.
#This is possibly confusing because this can come back without warning,
#but if a user tries to do any remoteSend, they will get a "cloud sick warning"
#Suggest cribbing the code from Internal.R that checks cloud status (or just call it here?)

h2o.clusterStatus <- function(client) {
if(missing(client) || class(client) != "H2OClient") stop("client must be a H2OClient object")
myURL = paste("http://", client@ip, ":", client@port, "/", .h2o.__PAGE_CLOUD, sep = "")
Expand Down
59 changes: 0 additions & 59 deletions R/h2o-package/man/h2o-package.Rd

This file was deleted.

0 comments on commit 96549b7

Please sign in to comment.