forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh2o-package.template
46 lines (43 loc) · 2.19 KB
/
h2o-package.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\name{h2o-package}
\alias{h2o-package}
\alias{h2o}
\docType{package}
\title{
H2O R Interface
}
\description{
This is a package for running H2O via its REST API from within R.
}
\details{
\tabular{ll}{
Package: \tab h2o\cr
Type: \tab Package\cr
Version: \tab SUBST_PROJECT_VERSION\cr
Date: \tab 2013-07-16\cr
License: \tab Apache-2\cr
Depends: \tab R (>= 2.13.0), RCurl, rjson\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}). Load the library and create a \code{\linkS4class{H2OClient}} object with the server IP and port. The command \code{\link{importFile}} will import and parse a delimited data file, returning an \code{\linkS4class{H2OParsedData}} 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 parsed data and parameters (response variable, error distribution) as arguments. (The operation will be done on the server associated with the data object).
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.
}
\author{
Anqi Fu, Tom Kraljevic and Petr Maj, with contributions from the 0xdata team
Maintainer: Anqi Fu <[email protected]>
}
\references{
\itemize{
\item \href{http://www.0xdata.com}{0xdata Homepage}
\item \href{https://github.com/0xdata/h2o}{H2O on Github}
}
}
\examples{
library(h2o)
localH2O = new("H2OClient", ip = "localhost", port = 54321)
h2o.checkClient(localH2O)
prostate.hex = h2o.importURL(localH2O, path = "https://raw.github.com/0xdata/h2o/master/smalldata/logreg/prostate.csv", key = "prostate.hex")
summary(prostate.hex)
prostate.glm = h2o.glm(y = "CAPSULE", x = c("AGE","RACE","PSA","DCAPS"), data = prostate.hex, family = "binomial", nfolds = 10, alpha = 0.5)
print(prostate.glm)
h2o.kmeans(data = prostate.hex, centers = 5)
}