Skip to content

Splashing a User Interface onto h2o MOJO Files

Notifications You must be signed in to change notification settings

jkhuangg/splash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

New Repo

This is the original repo for Splash. If you want to see the official repo, go to:
https://github.com/ML4LHS/splash

To check for my authorship:
https://github.com/ML4LHS/splash/blob/master/DESCRIPTION

How to call splash

library(splash)
library(h2o)

# set current working directory
curr_wd=dirname(rstudioapi::getSourceEditorContext()$path)
setwd(curr_wd)

# create h2o prostate mojo
h2o.init(nthreads = -1)
path <- system.file("extdata", "prostate.csv", package="h2o")
h2o_df <- h2o.importFile(path)
h2o_df$CAPSULE <- as.factor(h2o_df$CAPSULE)
h2o_df$RACE = as.factor(h2o_df$RACE)
model <- h2o.gbm(y = "CAPSULE",
                 x = c("AGE", "RACE", "PSA", "GLEASON"),
                 training_frame = h2o_df,
                 distribution = "bernoulli",
                 ntrees = 100,
                 max_depth = 4,
                 learn_rate = 0.1)

modelfile <- h2o.download_mojo(model, path= getwd(), get_genmodel_jar=TRUE)

# specifying all the parameters
splash(mojo_fn=modelfile,
       path=curr_wd,
       output_fn="index.Rmd",
       title="H2O prostate.csv Demo",
       author="ML4LHS",
       date="01/05/2021",
       output="html_document",
       runtime="shiny"
)

Screenshot of splash

Live Demo

This shiny app lives on:
https://jakehuang.shinyapps.io/splash_prostate_demo/

About

Splashing a User Interface onto h2o MOJO Files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages