Installation scripts for H2O driverless AI
Launch order
- install.sh (requires sudo)
- need to exit and re-ssh into machine for "docker usage without sudo" to take effect
- for GPU, refer to init-gpu.sh
- dropbox.sh (optional)
- start.sh
Installation scripts for H2O driverless AI
Launch order
library(shiny) | |
library(data.table) | |
ui <- fluidPage( | |
titlePanel("Multiple file uploads"), | |
sidebarLayout( | |
sidebarPanel( | |
fileInput("csvs", | |
label="Upload CSVs here", | |
multiple = TRUE) |
## For the user with a new installation of R. | |
# They get a USB stick with a directory containing an .RProj file, | |
# the workshop files, and the local_CRAN directory. They open | |
# the .RProj, which sets the working directory for RStudio, and then | |
# they open this file and run it, which installs pkgs from | |
# the local_CRAN directory on the USB stick. | |
# Specify list of packages to install | |
pkgs <- c('ggplot2', 'rmarkdown', 'knitr') |
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list' | |
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 | |
gpg -a --export E084DAB9 | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get -y install r-base libapparmor1 libcurl4-gnutls-dev libxml2-dev libssl-dev gdebi-core | |
sudo apt-get install libcairo2-dev | |
sudo apt-get install libxt-dev | |
sudo apt-get install git-core | |
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 |
belief | y2015 | y2014 | |
---|---|---|---|
Improves the security posture of my organization | 0.75 | 0.71 | |
Improves the security posture of the nations critical infrastructure | 0.63 | 0.64 | |
Reduces the cost of detecting and preventing cyber attacks | 0.22 | 0.21 | |
Improves situational awareness | 0.60 | 0.54 | |
Fosters collaboration among peers and industry groups | 0.48 | 0.51 | |
Enhances the timeliness of threat data | 0.11 | 0.16 | |
Makes threat data more actionable | 0.21 | 0.24 |
# Set a seed | |
set.seed(500) | |
library(MASS) | |
data <- Boston | |
# Check that no data is missing | |
apply(data,2,function(x) sum(is.na(x))) | |
# Train-test random splitting for linear model |
# This is an example to show how to access a set of variables named e. g. by an iterable during an iteration. | |
# | |
# BE WARNED: The following coding strategy is not easy to debug! | |
# | |
# Some like to generate variables, rather than having just one list of all data sets. | |
# That way you get an introspectable object for each data set – which particularly eases debugging in RStudio. | |
# To create variables in a loop or other generative iterations R provides paste(), assign() and get(). | |
# * With paste(), you can concatenate strings. (Use it to compose variable names.) | |
# * With assign(), you can give variables a value using their name in a string and of course the value you give. | |
# * With get() you can access such named variables using the sting. |
# check.packages function: install and load multiple R packages. | |
# Check to see if packages are installed. Install them if they are not, then load them into the R session. | |
check.packages <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} | |
# Usage example |
library(shiny) | |
library(dplyr) | |
library(lubridate) | |
# Load libraries and functions needed to create SQLite databases. | |
library(RSQLite) | |
library(RSQLite.extfuns) | |
saveSQLite <- function(data, name){ | |
path <- dplyr:::db_location(filename=paste0(name, ".sqlite")) |
Download and install:
Download the dummy csv file from this gist ( https://gist.github.com/psychemedia/9690079 )
In RStudio run:
install.packages("shiny")