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.
Merge branch 'master' of https://github.com/h2oai/h2o
- Loading branch information
Showing
27 changed files
with
839 additions
and
34 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
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
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
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
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,22 @@ | ||
\name{h2o.setLevel} | ||
\alias{h2o.setLevel} | ||
\title{Pattern Replacement} | ||
\description{ \code{h2o.setLevel}, a method to set a factor column to one of the levels.} | ||
\usage{h2o.setLevel(x, level)} | ||
\arguments{ | ||
\item{x}{An \code{\linkS4class{H2OParsedData}} object with a single factor column.} | ||
\item{level}{The level at which the column will be set.} | ||
} | ||
\details{ | ||
Replace all other occurrences with `level` in a factor column. | ||
} | ||
\value{ | ||
An object of class "H2OParsedData". | ||
} | ||
|
||
\examples{ | ||
library(h2o) | ||
localH2O <- h2o.init(ip = "localhost", port = 54321, startH2O = TRUE) | ||
hex <- as.h2o(localH2O , iris) | ||
hex$Species <- h2o.setLevel(hex$Species, "versicolor") | ||
} |
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
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
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
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
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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
.. _Roadmap: | ||
|
||
H\ :sub:`2`\ O Algorithms Roadmap | ||
================================== | ||
================================= | ||
|
||
.. raw:: html | ||
|
||
<div style="margin-top:10px;"> | ||
<iframe width=900 height=900 src="../bits/0xdata_H2O_Algorithms.pdf" frameborder="0" allowfullscreen></iframe> | ||
<iframe width=900 height=900 src="../bits/H2O-Algorithms-Road-Map.pdf" frameborder="0" allowfullscreen></iframe> | ||
</div> | ||
|
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 @@ | ||
name: Phil |
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,48 @@ | ||
buildscript { | ||
ext { | ||
springBootVersion = '1.3.0.BUILD-SNAPSHOT' | ||
} | ||
repositories { | ||
// NOTE: You should declare only repositories that you need here | ||
mavenLocal() | ||
mavenCentral() | ||
maven { url "http://repo.spring.io/release" } | ||
maven { url "http://repo.spring.io/milestone" } | ||
maven { url "http://repo.spring.io/snapshot" } | ||
} | ||
dependencies { | ||
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") | ||
} | ||
} | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'eclipse' | ||
apply plugin: 'idea' | ||
apply plugin: 'spring-boot' | ||
|
||
jar { | ||
baseName = 'spring-boot-sample-simple' | ||
version = '0.0.0' | ||
} | ||
|
||
run { | ||
systemProperties = System.properties | ||
} | ||
|
||
repositories { | ||
// NOTE: You should declare only repositories that you need here | ||
mavenLocal() | ||
mavenCentral() | ||
maven { url "http://repo.spring.io/release" } | ||
maven { url "http://repo.spring.io/milestone" } | ||
maven { url "http://repo.spring.io/snapshot" } | ||
} | ||
|
||
dependencies { | ||
compile("org.springframework.boot:spring-boot-starter") | ||
testCompile("org.springframework.boot:spring-boot-starter-test") | ||
} | ||
|
||
task wrapper(type: Wrapper) { | ||
gradleVersion = '1.6' | ||
} |
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,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<groupId>org.springframework.boot</groupId> | ||
<version>1.2.0.RELEASE</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<prerequisites> | ||
<maven>3.0.0</maven> | ||
</prerequisites> | ||
|
||
|
||
<artifactId>spring-boot-sample-simple</artifactId> | ||
<name>Spring Boot Simple Sample</name> | ||
<description>Spring Boot Simple Sample</description> | ||
<url>http://projects.spring.io/spring-boot/</url> | ||
<organization> | ||
<name>Pivotal Software, Inc.</name> | ||
<url>http://www.spring.io</url> | ||
</organization> | ||
<properties> | ||
<main.basedir>${basedir}/../..</main.basedir> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.json</groupId> | ||
<artifactId>json</artifactId> | ||
<version>20141113</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<jvmArguments>-Djava.rmi.server.hostname=localhost -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments> | ||
<arguments> | ||
<argument>--spring.profiles.active=dev</argument> | ||
</arguments> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
82 changes: 82 additions & 0 deletions
82
h2o-samples/devops-automation/src/main/java/sample/simple/SampleSimpleApplication.java
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,82 @@ | ||
/* | ||
* Copyright 2012-2013 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sample.simple; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
import sample.simple.service.HelloWorldService; | ||
import sample.simple.service.h2oService; | ||
|
||
@SpringBootApplication | ||
public class SampleSimpleApplication implements CommandLineRunner { | ||
|
||
static final String IMPORT_FILE = "/Users/paragsanghavi/Documents/h2o/smalldata/prostate/prostate.csv.zip"; | ||
|
||
// Simple example shows how a command line spring application can execute an | ||
// injected bean service. Also demonstrates how you can use @Value to inject | ||
// command line args ('--name=whatever') or application properties | ||
|
||
@Autowired | ||
private HelloWorldService helloWorldService; | ||
|
||
@Autowired | ||
private h2oService h2oservice; | ||
|
||
private final Logger log = LoggerFactory.getLogger(SampleSimpleApplication.class); | ||
|
||
@Override | ||
public void run(String... args) { | ||
System.out.println(this.helloWorldService.getHelloMessage()); | ||
String key_value = h2oservice.ImportCSVFile(IMPORT_FILE); | ||
if(!key_value.equalsIgnoreCase("error")){ | ||
String destination_key = h2oservice.ParseCSVFile(key_value,"prostate_csv.hex"); | ||
System.out.println(destination_key); | ||
if(destination_key!=null){ | ||
String gbm_key_value = h2oservice.BuildGBMModel("gbmmodelDestinationKey", destination_key); | ||
if(gbm_key_value!=null) { | ||
String predict = h2oservice.PredictGBM(gbm_key_value, destination_key); | ||
if(predict!=null){ | ||
Double AUC = h2oservice.CalculateAUC(destination_key,"CAPSULE", "1"); | ||
String download_pojo_location = h2oservice.DownloadPOJO("gbmmodelDestinationKey"); | ||
System.out.println(download_pojo_location); | ||
}else | ||
{ | ||
System.out.println("Error in prediction"); | ||
} | ||
}else{ | ||
System.out.println("Error in building GBM model"); | ||
} | ||
|
||
}else{ | ||
System.out.println("Error in parsing data set"); | ||
} | ||
|
||
}else{ | ||
log.debug("Error occurred in Importing File, {}", IMPORT_FILE); | ||
} | ||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
SpringApplication.run(SampleSimpleApplication.class, args); | ||
System.exit(0); | ||
} | ||
} |
Oops, something went wrong.