SlideShare a Scribd company logo
H2O.ai

Machine Intelligence
Intro to Machine Learning
with H2O and AWS
Navdeep Gill M.S.
Galvanize Seattle
May 2016
H2O.ai

Machine Intelligence
Introduction
• Hacker/Data Scientist @ H2O.ai
• Previous work:
• Cisco (Software Development/Data Science)
• FICO (Risk Management/Predictive Analytics)
• Motista (Market Research)
• Worked in Neuroscience Labs prior to industry (UC
Berkeley, UCSF, and Smith Kettlewell Eye Research
Institute) focusing on fMRI, EEG, and behavioral
studies with a keen focus on attention, visual
neuroscience, and aging
• Education:
• M.S. Computational Statistics @ CSU East Bay
• B.S./B.A. Statistics, Mathematics, and Psychology @
CSU East Bay
H2O.ai

Machine Intelligence
• What/who is H2O?
• H2O Platform
• H2O in Flow, R, Python, & Spark
(Sparkling Water)
• H2O in AWS
• H2O + EC2
• H2O + EMR
• H2O + AWS Lambda
H2O.ai

Machine Intelligence
H2O.ai
H2O Company
H2O Software
• Team: 50. Founded in 2012, Mountain View, CA
• Stanford Math & Systems Engineers
• Open Source Software

• Ease of Use via Web Interface
• R, Python, Scala, Spark & Hadoop Interfaces
• Distributed Algorithms Scale to Big Data
H2O.ai

Machine Intelligence
H2O.ai Founders
SriSatish Ambati
• CEO and Co-founder at H2O.ai
• Past: Platfora, Cassandra, DataStax, Azul Systems,
UC Berkeley
• CTO and Co-founder at H2O.ai

• Past: Azul Systems, Sun Microsystems
• Developed the Java HotSpot Server Compiler at Sun
• PhD in CS from Rice University
Dr. Cliff Click
H2O.ai

Machine Intelligence
Scientific Advisory Council
Dr. Trevor Hastie
Dr. Rob Tibshirani
Dr. Stephen Boyd
• John A. Overdeck Professor of Mathematics, Stanford University
• PhD in Statistics, Stanford University
• Co-author, The Elements of Statistical Learning: Prediction, Inference and Data Mining
• Co-author with John Chambers, Statistical Models in S
• Co-author, Generalized Additive Models
• 108,404 citations (via Google Scholar)
• Professor of Statistics and Health Research and Policy, Stanford University
• PhD in Statistics, Stanford University
• COPPS Presidents’ Award recipient
• Co-author, The Elements of Statistical Learning: Prediction, Inference and Data Mining
• Author, Regression Shrinkage and Selection via the Lasso
• Co-author, An Introduction to the Bootstrap
• Professor of Electrical Engineering and Computer Science, Stanford University
• PhD in Electrical Engineering and Computer Science, UC Berkeley
• Co-author, Convex Optimization
• Co-author, Linear Matrix Inequalities in System and Control Theory
• Co-author, Distributed Optimization and Statistical Learning via the Alternating Direction
Method of Multipliers
H2O.ai

Machine Intelligence
H2O Overview
Speed Matters!
No Sampling
Interactive UI
Cutting-Edge
Algorithms
• Time is valuable
• In-memory is faster
• Distributed is faster
• High speed AND accuracy
• Scale to big data
• Access data links
• Use all data without sampling
• Web-based modeling with H2O Flow
• Model comparison
• Suite of cutting-edge machine learning algorithms
• Deep Learning & Ensembles
• NanoFast Scoring Engine
H2O.ai

Machine Intelligence
Current Algorithm Overview
Statistical Analysis
• Linear Models (GLM)
• Naïve Bayes
Ensembles
• Random Forest
• Distributed Trees
• Gradient Boosting Machine
• R Package - Super Learner
Ensembles
Deep Neural Networks
• Multi-layer Feed-Forward Neural
Network
• Auto-encoder
• Anomaly Detection
• Deep Features
Clustering
• K-Means
Dimension Reduction
• Principal Component Analysis
• Generalized Low Rank Models
Solvers & Optimization
• Generalized ADMM Solver
• L-BFGS (Quasi Newton Method)
• Ordinary Least-Square Solver
• Stochastic Gradient Descent
Data Munging
• Scalable Data Frames
• Sort, Slice, Log Transform
H2O.ai

Machine Intelligence
https://github.com/h2oai/h2o-3
H2O.ai

Machine Intelligence
Distributed Key
Value Store
H2O Frame
H2O Components
• Multi-node cluster with shared memory model.
• All computations in memory.
• Each node sees only some rows of the data.
• No limit on cluster size.
• Objects in the H2O cluster such as data frames,
models and results are all referenced by key.
• Any node in the cluster can access any object in
the cluster by key.
• Distributed data frames (collection of vectors).
• Columns are distributed (across nodes) arrays.
• Each node must be able to see the entire dataset
(achieved using HDFS, S3, or multiple copies of
the data if it is a CSV file).
H2O Cluster
H2O.ai

Machine Intelligence
Distributed H2O Frame
Diagram of distributed arrays. An “H2O Frame” is a
collection of distributed arrays.
H2O.ai

Machine Intelligence
H2O Software
H2O is an open source, distributed, Java machine learning library.
APIs are available for:
R, Python, Scala & JSON
H2O.ai

Machine Intelligence
H2O.ai

Machine Intelligence
H2O Flow Interface
H2O.ai

Machine Intelligence
H2O in R & Python
H2O.ai

Machine Intelligence
Design
h2o R package
• The only requirement to run the “h2o” R package
is R >=3.1.0 and Java 7 or later.
• Linux, OS X and Windows.
• The easiest way to install the “h2o” R package is
to install directly from CRAN.
• Latest version: http://h2o.ai/download
• No computation is ever performed in R.
• All computations are performed (in highly
optimized Java code) in the H2O cluster and
initiated by REST calls from R.
Requirements
Installation
H2O.ai

Machine Intelligence
http://h2o.ai/download/h2o/r
H2O.ai

Machine Intelligence
Design
h2o Python module
• Java 7 or later.
• Python 2 or 3.
• A few Python module dependencies.
• Linux, OS X or Windows.
• The easiest way to install the “h2o” Python
module is PyPI (pip install).
• Latest version: http://h2o.ai/download
• No computation is ever performed in Python.
• All computations are performed in highly
optimized Java code in the H2O cluster and
initiated by REST calls from Python.
Requirements
Installation
H2O.ai

Machine Intelligence
http://h2o.ai/download/h2o/python
H2O.ai

Machine Intelligence
Start H2O Cluster from R
H2O.ai

Machine Intelligence
H2O in R: Load Data
R code example: Load data
H2O.ai

Machine Intelligence
H2O in R: Train & Test
R code example: Train and Test a GBM
H2O.ai

Machine Intelligence
H2O in R: Plotting
plot(fit) plots scoring history over time.
H2O.ai

Machine Intelligence
H2O in R: Grid Search
R code example: Execute a DL Grid Search
H2O.ai

Machine Intelligence
Start H2O Cluster from Python
H2O.ai

Machine Intelligence
Start H2O Cluster from Python
H2O.ai

Machine Intelligence
Train a model (e.g. GBM)
H2O.ai

Machine Intelligence
Inspect Model Performance
H2O.ai

Machine Intelligence
H2O in Spark
H2O.ai

Machine Intelligence
SparkR
Apache Spark and SparkR
• Apache Spark is an open source in-memory
processing engine built around speed.
• It was originally developed at UC Berkeley in
2009.
• Spark is commonly used on commodity clusters
(such as Amazon EC2).
• CRAY has been working with Spark community to
optimize Spark for CRAY supercomputers.
• Spark is written in Scala, but APIs exist for
Python and R.
• “SparkR” is the R API and has been part of Spark
since Spark 1.4 (June, 2015).
Apache Spark
Spark for HPC
H2O.ai

Machine Intelligence
Distributed Frames
H2O vs SparkR
• Major difference is that SparkR creates a
collection of slave R instances.
• H2O uses a single R session and communicates
to the H2O Java cluster via REST calls.
• In Spark 1.5 (latest release), only GLM is
accessible in R via SparkR.
• All H2O algorithms are available via R.
• Both H2O and Spark use distributed data frames.
• SparkR is most useful for data processing on
distributed data frames.
Architecture
Machine Learning
Algorithms
H2O.ai

Machine Intelligence
Sparkling Shell
H2O Sparkling Water
• Sparkling Water is transparent integration of H2O
into the Spark ecosystem.
• H2O runs inside the Spark Executor JVM.
• Provides advanced machine learning algorithms
to Spark workflows.
• Sophisticated alternative to the default MLlib
library in Spark.
• Sparkling Shell is just a standard Spark shell with
additional Sparkling Water classes
• export MASTER=“local-cluster[3,2,1024]”
• spark-shell —jars sparkling-water.jar
Spark Integration
Benefits
H2O.ai

Machine Intelligence
Where to learn more?
• H2O Online Training (free): http://learn.h2o.ai
• H2O Slidedecks: http://www.slideshare.net/0xdata
• H2O Video Presentations: https://www.youtube.com/user/0xdata
• H2O Community Events & Meetups: http://h2o.ai/events
• Machine Learning & Data Science courses: http://coursebuffet.com
H2O.ai

Machine Intelligence
H2O Booklets
https://github.com/h2oai/h2o-3/tree/master/h2o-docs/src/
booklets/v2_2015/PDFs/online
H2O.ai

Machine Intelligence
H2O in AWS
H2O.ai

Machine Intelligence
H2O in AWS
• Setting the stage…
• Information is the new gold and information
comes from data!
• Data is increasing everyday and at a rapid pace
• IoT
• Transactional Data
• Fraud, Risk & Marketing Analytics,
Consumer behavior, Churn, etc.
• Current ML algorithms must scale to data to
make meaningful predictions in a small time
window
• ML practitioners want answers and they want
them now!
• ML is great, but scalable ML is even better.
H2O.ai

Machine Intelligence
H2O in AWS
• H2O can achieve the previous with the
following:
• Highly optimized Java code(in-house)
• Distributed in memory KV store and map/
reduce computation framework
• Efficient data parser(HDFS,S3, NFS, HTTP,
local drives, etc)
• Read/write access to distributed data
frames
• ML algos that are distributed in a cluster
H2O.ai

Machine Intelligence
H2O in AWS
• AWS can help the previous cause as follows:
• Cloud computing on demand
• Scalable
• Using AWS tools, Auto Scaling, and Elastic
Load Balancing, your application can
scale up or down based on demand.
• Ability to access different compute
resources
• Different OS’s and compute power
• Reliable framework
• Cost effective
H2O.ai

Machine Intelligence
H2O in AWS
• H2O in AWS = Distributed Machine
Learning/Computing at your fingertips!
H2O.ai

Machine Intelligence
H2O on AWS EC2
H2O.ai

Machine Intelligence
What is Amazon EC2?
• Amazon Elastic Compute Cloud (Amazon EC2) is a web service that
provides resizable compute capacity in the cloud. It is designed to make
web-scale cloud computing easier for developers.
• Amazon EC2’s simple web service interface allows you to obtain and
configure capacity with minimal friction.
• It provides you with complete control of your computing resources and
lets you run on Amazon’s proven computing environment.
• Amazon EC2 reduces the time required to obtain and boot new server
instances to minutes, allowing you to quickly scale capacity, both up and
down, as your computing requirements change.
• Amazon EC2 changes the economics of computing by allowing you to
pay only for capacity that you actually use.
• Amazon EC2 provides developers the tools to build failure resilient
applications and isolate themselves from common failure scenarios.
H2O.ai

Machine Intelligence
Benefits of Amazon EC2
• Elastic Web Scale Computing
• Increase/decrease capacity within minutes.
• Commission one, hundreds, or thousands of server instances
simultaneously.
• Completely Controlled
• Root access to each instance (Interact with them as you would with any
machine).
• Stop instance while retaining the data on your boot partition.
• Flexible Cloud Hosting Services
• Multiple instance types and OS.
• Designed for use with other AWS services (S3, RDS, SQS)
• Reliable
• Secure
• AWS EC2 works in conjunction with Amazon VPC to provide security and
robust networking functionality.
• Decide which instances are exposed to the internet and which are private.
• Inexpensive
H2O.ai

Machine Intelligence
H2O on Amazon EC2
H2O can easily be deployed on an Amazon EC2 cluster. The
GitHub repository contains example scripts that 

help to automate the cluster deployment.
H2O.ai

Machine Intelligence
DEMO!
H2O.ai

Machine Intelligence
H2O Sparkling
Water on AWS EMR
H2O.ai

Machine Intelligence
What is AWS EMR?
• Amazon Elastic MapReduce (Amazon EMR) is a web service that makes
it easy to quickly and cost-effectively process vast amounts of data.
• Amazon EMR simplifies big data processing, providing a managed
Hadoop framework that makes it easy, fast, and cost-effective for you
to distribute and process vast amounts of your data across dynamically
scalable Amazon EC2 instances.
• You can also run other popular distributed frameworks such as Apache
Spark and Presto in Amazon EMR, and interact with data in other AWS
data stores such as Amazon S3 and Amazon DynamoDB.
• Amazon EMR securely and reliably handles your big data use cases,
including log analysis, web indexing, data warehousing, machine
learning, financial analysis, scientific simulation, and bioinformatics.
H2O.ai

Machine Intelligence
Benefits of Amazon EMR
• Easy to use
• You can launch an Amazon EMR cluster in minutes. No need to worry about
provisioning, cluster setup, Hadoop config, or cluster tuning.
• Low Cost
• You pay and hourly rate for every instance hour you use.
• Can launch 10 node hadoop cluster for as little as $0.15 an hour.
• Reliable
• Spend less time tuning and monitoring your cluster.
• EMR has tuned Hadoop for the cloud; also monitors your cluster — retrying
failed tasks and automatically replacing poorly performing instances
• Secure
• Amazon EMR automatically configures Amazon EC2 firewall settings that
control network access to instances, and you can launch clusters in an
Amazon Virtual Private Cloud (VPC), a logically isolated network you define.
• For objects stored in Amazon S3, you can use Amazon S3 server-side
encryption or Amazon S3 client-side encryption with EMRFS, with AWS Key
Management Service or customer-managed keys.
• Flexible just like Amazon EC2
H2O.ai

Machine Intelligence
DEMO!
H2O.ai

Machine Intelligence
H2O on AWS
Lambda
H2O.ai

Machine Intelligence
What is AWS Lambda?
• AWS Lambda lets you run code without provisioning or managing servers.
• You pay only for the compute time you consume - there is no charge when
your code is not running.
• With Lambda, you can run code for virtually any type of application or
backend service - all with zero administration.
• Just upload your code and Lambda takes care of everything required to run
and scale your code with high availability.
• You can set up your code to automatically trigger from other AWS services
or call it directly from any web or mobile app.
• It simplifies the process of running code in the cloud by managing compute
resources automatically.
• Offloads DevOps tasks related to VMs:
• Server and operating system maintenance
• Capacity provisioning
• Scaling
• Code monitoring and logging
• Security patches
H2O.ai

Machine Intelligence
Benefits of AWS Lambda
• No Servers to Manage
• AWS Lambda automatically runs your code without requiring you to
provision or manage servers. Just write the code and upload it to
Lambda.
• Continous Scaling
• AWS Lambda automatically scales your application by running code
in response to each trigger. Your code runs in parallel and processes
each trigger individually, scaling precisely with the size of the
workload.
• Sub second Monitoring
• With AWS Lambda, you are charged for every 100ms your code
executes and the number of times your code is triggered. You don't
pay anything when your code isn't running.
H2O.ai

Machine Intelligence
H2O + AWS Lambda = Machine
Learning Applications
H2O.ai

Machine Intelligence
Majors Steps for H2O + Lambda
Step 1: Identify problem to solve
Step 2:  Train model on data
Step 3:  Export the model as a POJO
Step 4: Write code for Lambda handler
Step 5:  Build deployment package (.zip
file) and upload to Lambda
Step 6:  Map API endpoint to Lambda
function
Step 7: Embed endpoint in application
H2O.ai

Machine Intelligence
Use Case: Domain Name
Classification
Malicious domains
Carry out malicious activity - botnets, phishing, malware
hosting, etc
Names are generated by algorithms to defeat security systems
Goal: Classify domains as legitimate vs. malicious
Legitimate Malicious
h2o zyxgifnjobqhzptuodmzov
zen-cart c3p4j7zdxexg1f2tuzk117wyzn
fedoraforum batdtrbtrikw
H2O.ai

Machine Intelligence
Features
• String length
• Shannon Entropy
• Measure of uncertainty in a random variable
• Number of substrings that are English words
• Proportion of vowels
H2O.ai

Machine Intelligence
Data
• Domains and whether they are malicious
• http://datadrivensecurity.info/blog/data/2014/10/legit-dga_domains.csv.zip
• 133,927 rows
• English words
• https://raw.githubusercontent.com/dwyl/english-words/master/words.txt
• 354,985 rows
H2O.ai

Machine Intelligence
Model Information
Malicious	Domain	Model
Algorithm:	 GLM
Model	family: Binomial
Regularization: Ridge
Threshold	(max	F1): 0.4935
Class 0 1 Error
0 15889 315 FPR	
0.0194
1 346 10043 FNR
0.0333
Confusion matrix on validation data
Actual
Predicted
H2O.ai

Machine Intelligence
Workflow For This App
Input	domain	
name
Get	Predictions
Malicious	
Domain?
Visit	web	
page
Malicious Legitimate
Yes No
H2O.ai

Machine Intelligence
APP Arch Diagram
REST	
endpoint
JavaScript	
App
Lambda
Jython
Feature	
Munging
Lambda
Function
Handler
H2O	Model	
POJO	
Prediction
HTTPS
POST
domain
name
JSON
with
prediction
H2O.ai

Machine Intelligence
DEMO!
H2O.ai

Machine Intelligence
Lambda Function Handler
public	static	ResponseClass myHandler(RequestClass
request,	Context	context)	throws	PyException {
PyModule module	=	new	PyModule();
//Prediction	code	is	in	pymodule.py
double[]predictions=module.predict(request.domain);
return	new	ResponseClass(predictions);
}
REST	
endpoint
Jython
Feature	
Munging
Lambda
Function
Handler
H2O	Model	
POJO	
Prediction
H2O.ai

Machine Intelligence
Jython Feature Munging
def predict(domain):
domain	=	domain.split('.')[0]
row	=	RowData()
functions	=	[len,	entropy,	p_vowels,	num_valid_substrings]
eval_features =	[f(domain)	for	f	in	functions]
names	=	NamesHolder_MaliciousDomainModel().VALUES
beta	=	MaliciousDomainModel().BETA().VALUES
feature_coef_product =	[beta[len(beta)	- 1]]
for	i in	range(len(names)):
row.put(names[i],	float(eval_features[i]))
feature_coef_product.append(eval_features[i]	*	beta[i])
#prediction
model	=	EasyPredictModelWrapper(MaliciousDomainModel())
p	=	model.predictBinomial(row)
REST	
endpoint
Jython
Feature	
Munging
Lambda
Function
Handler
H2O	Model	
POJO	
Prediction
H2O.ai

Machine Intelligence
H2O Model POJO
• static	final	class	BETA_0	implements	java.io.Serializable {
static	final	void	fill(double[]	sa)	{
sa[0]	=	1.49207826021648;
sa[1]	=	2.8502716978560194;
sa[2]	=	-8.839804567200542;
sa[3]	=	-0.7977065034624655;
sa[4]	=	-14.94132841574946;
}
}
REST	
endpoint
Jython
Feature	
Munging
Lambda
Function
Handler
H2O	Model	
POJO	
Prediction
H2O.ai

Machine Intelligence
Thank you!
@Navdeep_Gill_ on Twitter
navdeep-G on GitHub
navdeep@h2o.ai
Slides available at: https://github.com/h2oai/h2o-meetups/tree/master/2016_05_25_AWS
H2O + EC2 Tutorial: https://github.com/h2oai/h2o-3/tree/master/ec2
H2O +EMR Tutorial: https://github.com/navdeep-G/sparkling-water-emr
H2O + AWS Lambda Tutorial: https://github.com/h2oai/app-malicious-domains

More Related Content

What's hot (20)

PDF
[216]네이버 검색 사용자를 만족시켜라! 의도파악과 의미검색
NAVER D2
 
PDF
Concept Drift: Monitoring Model Quality In Streaming ML Applications
Lightbend
 
PDF
Real-time processing of large amounts of data
confluent
 
PDF
GraphSage vs Pinsage #InsideArangoDB
ArangoDB Database
 
PDF
正則化つき線形モデル(「入門機械学習第6章」より)
Eric Sartre
 
PDF
Tutorial: Context In Recommender Systems
YONG ZHENG
 
PDF
第3回 配信講義 計算科学技術特論A (2021)
RCCSRENKEI
 
PDF
論文紹介:Grad-CAM: Visual explanations from deep networks via gradient-based loca...
Kazuki Adachi
 
PPTX
【ICLR2023】論文紹介: Image as Set of Points
Shoki Miyagawa
 
PDF
Frequently Bought Together Recommendations Based on Embeddings
Databricks
 
PDF
Deep Learning
Masayoshi Kondo
 
PDF
Netflix Recommendations - Beyond the 5 Stars
Xavier Amatriain
 
PPTX
Resnet.pptx
YanhuaSi
 
PPTX
Semantic Segmentation Methods using Deep Learning
Sungjoon Choi
 
PPTX
WBICによる混合正規分布の分離と抽出
Yusuke TAMAI
 
PDF
第4回 配信講義 計算科学技術特論A (2021)
RCCSRENKEI
 
PPTX
Learn to Rank search results
Ganesh Venkataraman
 
PDF
Densenet CNN
ArunKumar7374
 
PDF
[DL輪読会]Network Deconvolution
Deep Learning JP
 
PDF
Counterfactual Learning for Recommendation
Olivier Jeunen
 
[216]네이버 검색 사용자를 만족시켜라! 의도파악과 의미검색
NAVER D2
 
Concept Drift: Monitoring Model Quality In Streaming ML Applications
Lightbend
 
Real-time processing of large amounts of data
confluent
 
GraphSage vs Pinsage #InsideArangoDB
ArangoDB Database
 
正則化つき線形モデル(「入門機械学習第6章」より)
Eric Sartre
 
Tutorial: Context In Recommender Systems
YONG ZHENG
 
第3回 配信講義 計算科学技術特論A (2021)
RCCSRENKEI
 
論文紹介:Grad-CAM: Visual explanations from deep networks via gradient-based loca...
Kazuki Adachi
 
【ICLR2023】論文紹介: Image as Set of Points
Shoki Miyagawa
 
Frequently Bought Together Recommendations Based on Embeddings
Databricks
 
Deep Learning
Masayoshi Kondo
 
Netflix Recommendations - Beyond the 5 Stars
Xavier Amatriain
 
Resnet.pptx
YanhuaSi
 
Semantic Segmentation Methods using Deep Learning
Sungjoon Choi
 
WBICによる混合正規分布の分離と抽出
Yusuke TAMAI
 
第4回 配信講義 計算科学技術特論A (2021)
RCCSRENKEI
 
Learn to Rank search results
Ganesh Venkataraman
 
Densenet CNN
ArunKumar7374
 
[DL輪読会]Network Deconvolution
Deep Learning JP
 
Counterfactual Learning for Recommendation
Olivier Jeunen
 

Viewers also liked (9)

PDF
NLP with H2O
Sri Ambati
 
PDF
Anti-Money Laundering Solution
Sri Ambati
 
PDF
Build Your Own Recommendation Engine
Sri Ambati
 
PDF
H2O Big Join Slides
Sri Ambati
 
PDF
Intro to Machine Learning for GPUs
Sri Ambati
 
PDF
Horovod - Distributed TensorFlow Made Easy
Alexander Sergeev
 
PDF
Parameter Server Approach for Online Learning at Twitter
Zhiyong (Joe) Xie
 
PDF
Large-Scale Training with GPUs at Facebook
Faisal Siddiqi
 
PDF
2017 10-10 (netflix ml platform meetup) learning item and user representation...
Ed Chi
 
NLP with H2O
Sri Ambati
 
Anti-Money Laundering Solution
Sri Ambati
 
Build Your Own Recommendation Engine
Sri Ambati
 
H2O Big Join Slides
Sri Ambati
 
Intro to Machine Learning for GPUs
Sri Ambati
 
Horovod - Distributed TensorFlow Made Easy
Alexander Sergeev
 
Parameter Server Approach for Online Learning at Twitter
Zhiyong (Joe) Xie
 
Large-Scale Training with GPUs at Facebook
Faisal Siddiqi
 
2017 10-10 (netflix ml platform meetup) learning item and user representation...
Ed Chi
 
Ad

Similar to Intro to Machine Learning with H2O and AWS (20)

PDF
Intro to H2O Machine Learning in R at Santa Clara University
Sri Ambati
 
PDF
High Performance Machine Learning in R with H2O
Sri Ambati
 
PDF
H2O Overview with Amy Wang at useR! Aalborg
Sri Ambati
 
PPTX
ISV Showcase: End-to-end Machine Learning using H2O on Azure
Microsoft Tech Community
 
PDF
Intro to H2O Machine Learning in Python - Galvanize Seattle
Sri Ambati
 
PDF
New Developments in H2O: April 2017 Edition
Sri Ambati
 
PDF
Intro to H2O in Python - Data Science LA
Sri Ambati
 
PDF
Scalable Machine Learning in R and Python with H2O
Sri Ambati
 
PDF
H2O at Berlin R Meetup
Jo-fai Chow
 
PDF
Berlin R Meetup
Sri Ambati
 
PDF
Start Getting Your Feet Wet in Open Source Machine and Deep Learning
Ian Gomez
 
PDF
Introduction to H2O and Model Stacking Use Cases
Jo-fai Chow
 
PDF
Python and H2O with Cliff Click at PyData Dallas 2015
Sri Ambati
 
PDF
Introduction to Machine Learning with H2O and Python
Jo-fai Chow
 
PDF
Machine Learning With H2O vs SparkML
Arnab Biswas
 
PDF
H2O with Erin LeDell at Portland R User Group
Sri Ambati
 
PDF
H2O at Poznan R Meetup
Jo-fai Chow
 
PDF
Introducción al Aprendizaje Automatico con H2O-3 (1)
Sri Ambati
 
PPTX
Intro to R and H2O with Spencer Aiello
Sri Ambati
 
PDF
H2O at BelgradeR Meetup
Jo-fai Chow
 
Intro to H2O Machine Learning in R at Santa Clara University
Sri Ambati
 
High Performance Machine Learning in R with H2O
Sri Ambati
 
H2O Overview with Amy Wang at useR! Aalborg
Sri Ambati
 
ISV Showcase: End-to-end Machine Learning using H2O on Azure
Microsoft Tech Community
 
Intro to H2O Machine Learning in Python - Galvanize Seattle
Sri Ambati
 
New Developments in H2O: April 2017 Edition
Sri Ambati
 
Intro to H2O in Python - Data Science LA
Sri Ambati
 
Scalable Machine Learning in R and Python with H2O
Sri Ambati
 
H2O at Berlin R Meetup
Jo-fai Chow
 
Berlin R Meetup
Sri Ambati
 
Start Getting Your Feet Wet in Open Source Machine and Deep Learning
Ian Gomez
 
Introduction to H2O and Model Stacking Use Cases
Jo-fai Chow
 
Python and H2O with Cliff Click at PyData Dallas 2015
Sri Ambati
 
Introduction to Machine Learning with H2O and Python
Jo-fai Chow
 
Machine Learning With H2O vs SparkML
Arnab Biswas
 
H2O with Erin LeDell at Portland R User Group
Sri Ambati
 
H2O at Poznan R Meetup
Jo-fai Chow
 
Introducción al Aprendizaje Automatico con H2O-3 (1)
Sri Ambati
 
Intro to R and H2O with Spencer Aiello
Sri Ambati
 
H2O at BelgradeR Meetup
Jo-fai Chow
 
Ad

More from Sri Ambati (20)

PDF
H2O Label Genie Starter Track - Support Presentation
Sri Ambati
 
PDF
H2O.ai Agents : From Theory to Practice - Support Presentation
Sri Ambati
 
PDF
H2O Generative AI Starter Track - Support Presentation Slides.pdf
Sri Ambati
 
PDF
H2O Gen AI Ecosystem Overview - Level 1 - Slide Deck
Sri Ambati
 
PDF
An In-depth Exploration of Enterprise h2oGPTe Slide Deck
Sri Ambati
 
PDF
Intro to Enterprise h2oGPTe Presentation Slides
Sri Ambati
 
PDF
Enterprise h2o GPTe Learning Path Slide Deck
Sri Ambati
 
PDF
H2O Wave Course Starter - Presentation Slides
Sri Ambati
 
PDF
Large Language Models (LLMs) - Level 3 Slides
Sri Ambati
 
PDF
Data Science and Machine Learning Platforms (2024) Slides
Sri Ambati
 
PDF
Data Prep for H2O Driverless AI - Slides
Sri Ambati
 
PDF
H2O Cloud AI Developer Services - Slides (2024)
Sri Ambati
 
PDF
LLM Learning Path Level 2 - Presentation Slides
Sri Ambati
 
PDF
LLM Learning Path Level 1 - Presentation Slides
Sri Ambati
 
PDF
Hydrogen Torch - Starter Course - Presentation Slides
Sri Ambati
 
PDF
Presentation Resources - H2O Gen AI Ecosystem Overview - Level 2
Sri Ambati
 
PDF
H2O Driverless AI Starter Course - Slides and Assignments
Sri Ambati
 
PPTX
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
PDF
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
Sri Ambati
 
PPTX
Generative AI Masterclass - Model Risk Management.pptx
Sri Ambati
 
H2O Label Genie Starter Track - Support Presentation
Sri Ambati
 
H2O.ai Agents : From Theory to Practice - Support Presentation
Sri Ambati
 
H2O Generative AI Starter Track - Support Presentation Slides.pdf
Sri Ambati
 
H2O Gen AI Ecosystem Overview - Level 1 - Slide Deck
Sri Ambati
 
An In-depth Exploration of Enterprise h2oGPTe Slide Deck
Sri Ambati
 
Intro to Enterprise h2oGPTe Presentation Slides
Sri Ambati
 
Enterprise h2o GPTe Learning Path Slide Deck
Sri Ambati
 
H2O Wave Course Starter - Presentation Slides
Sri Ambati
 
Large Language Models (LLMs) - Level 3 Slides
Sri Ambati
 
Data Science and Machine Learning Platforms (2024) Slides
Sri Ambati
 
Data Prep for H2O Driverless AI - Slides
Sri Ambati
 
H2O Cloud AI Developer Services - Slides (2024)
Sri Ambati
 
LLM Learning Path Level 2 - Presentation Slides
Sri Ambati
 
LLM Learning Path Level 1 - Presentation Slides
Sri Ambati
 
Hydrogen Torch - Starter Course - Presentation Slides
Sri Ambati
 
Presentation Resources - H2O Gen AI Ecosystem Overview - Level 2
Sri Ambati
 
H2O Driverless AI Starter Course - Slides and Assignments
Sri Ambati
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
Sri Ambati
 
Generative AI Masterclass - Model Risk Management.pptx
Sri Ambati
 

Recently uploaded (20)

PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 

Intro to Machine Learning with H2O and AWS

  • 1. H2O.ai
 Machine Intelligence Intro to Machine Learning with H2O and AWS Navdeep Gill M.S. Galvanize Seattle May 2016
  • 2. H2O.ai
 Machine Intelligence Introduction • Hacker/Data Scientist @ H2O.ai • Previous work: • Cisco (Software Development/Data Science) • FICO (Risk Management/Predictive Analytics) • Motista (Market Research) • Worked in Neuroscience Labs prior to industry (UC Berkeley, UCSF, and Smith Kettlewell Eye Research Institute) focusing on fMRI, EEG, and behavioral studies with a keen focus on attention, visual neuroscience, and aging • Education: • M.S. Computational Statistics @ CSU East Bay • B.S./B.A. Statistics, Mathematics, and Psychology @ CSU East Bay
  • 3. H2O.ai
 Machine Intelligence • What/who is H2O? • H2O Platform • H2O in Flow, R, Python, & Spark (Sparkling Water) • H2O in AWS • H2O + EC2 • H2O + EMR • H2O + AWS Lambda
  • 4. H2O.ai
 Machine Intelligence H2O.ai H2O Company H2O Software • Team: 50. Founded in 2012, Mountain View, CA • Stanford Math & Systems Engineers • Open Source Software
 • Ease of Use via Web Interface • R, Python, Scala, Spark & Hadoop Interfaces • Distributed Algorithms Scale to Big Data
  • 5. H2O.ai
 Machine Intelligence H2O.ai Founders SriSatish Ambati • CEO and Co-founder at H2O.ai • Past: Platfora, Cassandra, DataStax, Azul Systems, UC Berkeley • CTO and Co-founder at H2O.ai
 • Past: Azul Systems, Sun Microsystems • Developed the Java HotSpot Server Compiler at Sun • PhD in CS from Rice University Dr. Cliff Click
  • 6. H2O.ai
 Machine Intelligence Scientific Advisory Council Dr. Trevor Hastie Dr. Rob Tibshirani Dr. Stephen Boyd • John A. Overdeck Professor of Mathematics, Stanford University • PhD in Statistics, Stanford University • Co-author, The Elements of Statistical Learning: Prediction, Inference and Data Mining • Co-author with John Chambers, Statistical Models in S • Co-author, Generalized Additive Models • 108,404 citations (via Google Scholar) • Professor of Statistics and Health Research and Policy, Stanford University • PhD in Statistics, Stanford University • COPPS Presidents’ Award recipient • Co-author, The Elements of Statistical Learning: Prediction, Inference and Data Mining • Author, Regression Shrinkage and Selection via the Lasso • Co-author, An Introduction to the Bootstrap • Professor of Electrical Engineering and Computer Science, Stanford University • PhD in Electrical Engineering and Computer Science, UC Berkeley • Co-author, Convex Optimization • Co-author, Linear Matrix Inequalities in System and Control Theory • Co-author, Distributed Optimization and Statistical Learning via the Alternating Direction Method of Multipliers
  • 7. H2O.ai
 Machine Intelligence H2O Overview Speed Matters! No Sampling Interactive UI Cutting-Edge Algorithms • Time is valuable • In-memory is faster • Distributed is faster • High speed AND accuracy • Scale to big data • Access data links • Use all data without sampling • Web-based modeling with H2O Flow • Model comparison • Suite of cutting-edge machine learning algorithms • Deep Learning & Ensembles • NanoFast Scoring Engine
  • 8. H2O.ai
 Machine Intelligence Current Algorithm Overview Statistical Analysis • Linear Models (GLM) • Naïve Bayes Ensembles • Random Forest • Distributed Trees • Gradient Boosting Machine • R Package - Super Learner Ensembles Deep Neural Networks • Multi-layer Feed-Forward Neural Network • Auto-encoder • Anomaly Detection • Deep Features Clustering • K-Means Dimension Reduction • Principal Component Analysis • Generalized Low Rank Models Solvers & Optimization • Generalized ADMM Solver • L-BFGS (Quasi Newton Method) • Ordinary Least-Square Solver • Stochastic Gradient Descent Data Munging • Scalable Data Frames • Sort, Slice, Log Transform
  • 10. H2O.ai
 Machine Intelligence Distributed Key Value Store H2O Frame H2O Components • Multi-node cluster with shared memory model. • All computations in memory. • Each node sees only some rows of the data. • No limit on cluster size. • Objects in the H2O cluster such as data frames, models and results are all referenced by key. • Any node in the cluster can access any object in the cluster by key. • Distributed data frames (collection of vectors). • Columns are distributed (across nodes) arrays. • Each node must be able to see the entire dataset (achieved using HDFS, S3, or multiple copies of the data if it is a CSV file). H2O Cluster
  • 11. H2O.ai
 Machine Intelligence Distributed H2O Frame Diagram of distributed arrays. An “H2O Frame” is a collection of distributed arrays.
  • 12. H2O.ai
 Machine Intelligence H2O Software H2O is an open source, distributed, Java machine learning library. APIs are available for: R, Python, Scala & JSON
  • 16. H2O.ai
 Machine Intelligence Design h2o R package • The only requirement to run the “h2o” R package is R >=3.1.0 and Java 7 or later. • Linux, OS X and Windows. • The easiest way to install the “h2o” R package is to install directly from CRAN. • Latest version: http://h2o.ai/download • No computation is ever performed in R. • All computations are performed (in highly optimized Java code) in the H2O cluster and initiated by REST calls from R. Requirements Installation
  • 18. H2O.ai
 Machine Intelligence Design h2o Python module • Java 7 or later. • Python 2 or 3. • A few Python module dependencies. • Linux, OS X or Windows. • The easiest way to install the “h2o” Python module is PyPI (pip install). • Latest version: http://h2o.ai/download • No computation is ever performed in Python. • All computations are performed in highly optimized Java code in the H2O cluster and initiated by REST calls from Python. Requirements Installation
  • 21. H2O.ai
 Machine Intelligence H2O in R: Load Data R code example: Load data
  • 22. H2O.ai
 Machine Intelligence H2O in R: Train & Test R code example: Train and Test a GBM
  • 23. H2O.ai
 Machine Intelligence H2O in R: Plotting plot(fit) plots scoring history over time.
  • 24. H2O.ai
 Machine Intelligence H2O in R: Grid Search R code example: Execute a DL Grid Search
  • 30. H2O.ai
 Machine Intelligence SparkR Apache Spark and SparkR • Apache Spark is an open source in-memory processing engine built around speed. • It was originally developed at UC Berkeley in 2009. • Spark is commonly used on commodity clusters (such as Amazon EC2). • CRAY has been working with Spark community to optimize Spark for CRAY supercomputers. • Spark is written in Scala, but APIs exist for Python and R. • “SparkR” is the R API and has been part of Spark since Spark 1.4 (June, 2015). Apache Spark Spark for HPC
  • 31. H2O.ai
 Machine Intelligence Distributed Frames H2O vs SparkR • Major difference is that SparkR creates a collection of slave R instances. • H2O uses a single R session and communicates to the H2O Java cluster via REST calls. • In Spark 1.5 (latest release), only GLM is accessible in R via SparkR. • All H2O algorithms are available via R. • Both H2O and Spark use distributed data frames. • SparkR is most useful for data processing on distributed data frames. Architecture Machine Learning Algorithms
  • 32. H2O.ai
 Machine Intelligence Sparkling Shell H2O Sparkling Water • Sparkling Water is transparent integration of H2O into the Spark ecosystem. • H2O runs inside the Spark Executor JVM. • Provides advanced machine learning algorithms to Spark workflows. • Sophisticated alternative to the default MLlib library in Spark. • Sparkling Shell is just a standard Spark shell with additional Sparkling Water classes • export MASTER=“local-cluster[3,2,1024]” • spark-shell —jars sparkling-water.jar Spark Integration Benefits
  • 33. H2O.ai
 Machine Intelligence Where to learn more? • H2O Online Training (free): http://learn.h2o.ai • H2O Slidedecks: http://www.slideshare.net/0xdata • H2O Video Presentations: https://www.youtube.com/user/0xdata • H2O Community Events & Meetups: http://h2o.ai/events • Machine Learning & Data Science courses: http://coursebuffet.com
  • 36. H2O.ai
 Machine Intelligence H2O in AWS • Setting the stage… • Information is the new gold and information comes from data! • Data is increasing everyday and at a rapid pace • IoT • Transactional Data • Fraud, Risk & Marketing Analytics, Consumer behavior, Churn, etc. • Current ML algorithms must scale to data to make meaningful predictions in a small time window • ML practitioners want answers and they want them now! • ML is great, but scalable ML is even better.
  • 37. H2O.ai
 Machine Intelligence H2O in AWS • H2O can achieve the previous with the following: • Highly optimized Java code(in-house) • Distributed in memory KV store and map/ reduce computation framework • Efficient data parser(HDFS,S3, NFS, HTTP, local drives, etc) • Read/write access to distributed data frames • ML algos that are distributed in a cluster
  • 38. H2O.ai
 Machine Intelligence H2O in AWS • AWS can help the previous cause as follows: • Cloud computing on demand • Scalable • Using AWS tools, Auto Scaling, and Elastic Load Balancing, your application can scale up or down based on demand. • Ability to access different compute resources • Different OS’s and compute power • Reliable framework • Cost effective
  • 39. H2O.ai
 Machine Intelligence H2O in AWS • H2O in AWS = Distributed Machine Learning/Computing at your fingertips!
  • 41. H2O.ai
 Machine Intelligence What is Amazon EC2? • Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. • Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. • It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. • Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. • Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. • Amazon EC2 provides developers the tools to build failure resilient applications and isolate themselves from common failure scenarios.
  • 42. H2O.ai
 Machine Intelligence Benefits of Amazon EC2 • Elastic Web Scale Computing • Increase/decrease capacity within minutes. • Commission one, hundreds, or thousands of server instances simultaneously. • Completely Controlled • Root access to each instance (Interact with them as you would with any machine). • Stop instance while retaining the data on your boot partition. • Flexible Cloud Hosting Services • Multiple instance types and OS. • Designed for use with other AWS services (S3, RDS, SQS) • Reliable • Secure • AWS EC2 works in conjunction with Amazon VPC to provide security and robust networking functionality. • Decide which instances are exposed to the internet and which are private. • Inexpensive
  • 43. H2O.ai
 Machine Intelligence H2O on Amazon EC2 H2O can easily be deployed on an Amazon EC2 cluster. The GitHub repository contains example scripts that 
 help to automate the cluster deployment.
  • 46. H2O.ai
 Machine Intelligence What is AWS EMR? • Amazon Elastic MapReduce (Amazon EMR) is a web service that makes it easy to quickly and cost-effectively process vast amounts of data. • Amazon EMR simplifies big data processing, providing a managed Hadoop framework that makes it easy, fast, and cost-effective for you to distribute and process vast amounts of your data across dynamically scalable Amazon EC2 instances. • You can also run other popular distributed frameworks such as Apache Spark and Presto in Amazon EMR, and interact with data in other AWS data stores such as Amazon S3 and Amazon DynamoDB. • Amazon EMR securely and reliably handles your big data use cases, including log analysis, web indexing, data warehousing, machine learning, financial analysis, scientific simulation, and bioinformatics.
  • 47. H2O.ai
 Machine Intelligence Benefits of Amazon EMR • Easy to use • You can launch an Amazon EMR cluster in minutes. No need to worry about provisioning, cluster setup, Hadoop config, or cluster tuning. • Low Cost • You pay and hourly rate for every instance hour you use. • Can launch 10 node hadoop cluster for as little as $0.15 an hour. • Reliable • Spend less time tuning and monitoring your cluster. • EMR has tuned Hadoop for the cloud; also monitors your cluster — retrying failed tasks and automatically replacing poorly performing instances • Secure • Amazon EMR automatically configures Amazon EC2 firewall settings that control network access to instances, and you can launch clusters in an Amazon Virtual Private Cloud (VPC), a logically isolated network you define. • For objects stored in Amazon S3, you can use Amazon S3 server-side encryption or Amazon S3 client-side encryption with EMRFS, with AWS Key Management Service or customer-managed keys. • Flexible just like Amazon EC2
  • 50. H2O.ai
 Machine Intelligence What is AWS Lambda? • AWS Lambda lets you run code without provisioning or managing servers. • You pay only for the compute time you consume - there is no charge when your code is not running. • With Lambda, you can run code for virtually any type of application or backend service - all with zero administration. • Just upload your code and Lambda takes care of everything required to run and scale your code with high availability. • You can set up your code to automatically trigger from other AWS services or call it directly from any web or mobile app. • It simplifies the process of running code in the cloud by managing compute resources automatically. • Offloads DevOps tasks related to VMs: • Server and operating system maintenance • Capacity provisioning • Scaling • Code monitoring and logging • Security patches
  • 51. H2O.ai
 Machine Intelligence Benefits of AWS Lambda • No Servers to Manage • AWS Lambda automatically runs your code without requiring you to provision or manage servers. Just write the code and upload it to Lambda. • Continous Scaling • AWS Lambda automatically scales your application by running code in response to each trigger. Your code runs in parallel and processes each trigger individually, scaling precisely with the size of the workload. • Sub second Monitoring • With AWS Lambda, you are charged for every 100ms your code executes and the number of times your code is triggered. You don't pay anything when your code isn't running.
  • 52. H2O.ai
 Machine Intelligence H2O + AWS Lambda = Machine Learning Applications
  • 53. H2O.ai
 Machine Intelligence Majors Steps for H2O + Lambda Step 1: Identify problem to solve Step 2:  Train model on data Step 3:  Export the model as a POJO Step 4: Write code for Lambda handler Step 5:  Build deployment package (.zip file) and upload to Lambda Step 6:  Map API endpoint to Lambda function Step 7: Embed endpoint in application
  • 54. H2O.ai
 Machine Intelligence Use Case: Domain Name Classification Malicious domains Carry out malicious activity - botnets, phishing, malware hosting, etc Names are generated by algorithms to defeat security systems Goal: Classify domains as legitimate vs. malicious Legitimate Malicious h2o zyxgifnjobqhzptuodmzov zen-cart c3p4j7zdxexg1f2tuzk117wyzn fedoraforum batdtrbtrikw
  • 55. H2O.ai
 Machine Intelligence Features • String length • Shannon Entropy • Measure of uncertainty in a random variable • Number of substrings that are English words • Proportion of vowels
  • 56. H2O.ai
 Machine Intelligence Data • Domains and whether they are malicious • http://datadrivensecurity.info/blog/data/2014/10/legit-dga_domains.csv.zip • 133,927 rows • English words • https://raw.githubusercontent.com/dwyl/english-words/master/words.txt • 354,985 rows
  • 57. H2O.ai
 Machine Intelligence Model Information Malicious Domain Model Algorithm: GLM Model family: Binomial Regularization: Ridge Threshold (max F1): 0.4935 Class 0 1 Error 0 15889 315 FPR 0.0194 1 346 10043 FNR 0.0333 Confusion matrix on validation data Actual Predicted
  • 58. H2O.ai
 Machine Intelligence Workflow For This App Input domain name Get Predictions Malicious Domain? Visit web page Malicious Legitimate Yes No
  • 59. H2O.ai
 Machine Intelligence APP Arch Diagram REST endpoint JavaScript App Lambda Jython Feature Munging Lambda Function Handler H2O Model POJO Prediction HTTPS POST domain name JSON with prediction
  • 61. H2O.ai
 Machine Intelligence Lambda Function Handler public static ResponseClass myHandler(RequestClass request, Context context) throws PyException { PyModule module = new PyModule(); //Prediction code is in pymodule.py double[]predictions=module.predict(request.domain); return new ResponseClass(predictions); } REST endpoint Jython Feature Munging Lambda Function Handler H2O Model POJO Prediction
  • 62. H2O.ai
 Machine Intelligence Jython Feature Munging def predict(domain): domain = domain.split('.')[0] row = RowData() functions = [len, entropy, p_vowels, num_valid_substrings] eval_features = [f(domain) for f in functions] names = NamesHolder_MaliciousDomainModel().VALUES beta = MaliciousDomainModel().BETA().VALUES feature_coef_product = [beta[len(beta) - 1]] for i in range(len(names)): row.put(names[i], float(eval_features[i])) feature_coef_product.append(eval_features[i] * beta[i]) #prediction model = EasyPredictModelWrapper(MaliciousDomainModel()) p = model.predictBinomial(row) REST endpoint Jython Feature Munging Lambda Function Handler H2O Model POJO Prediction
  • 63. H2O.ai
 Machine Intelligence H2O Model POJO • static final class BETA_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 1.49207826021648; sa[1] = 2.8502716978560194; sa[2] = -8.839804567200542; sa[3] = -0.7977065034624655; sa[4] = -14.94132841574946; } } REST endpoint Jython Feature Munging Lambda Function Handler H2O Model POJO Prediction
  • 64. H2O.ai
 Machine Intelligence Thank you! @Navdeep_Gill_ on Twitter navdeep-G on GitHub [email protected] Slides available at: https://github.com/h2oai/h2o-meetups/tree/master/2016_05_25_AWS H2O + EC2 Tutorial: https://github.com/h2oai/h2o-3/tree/master/ec2 H2O +EMR Tutorial: https://github.com/navdeep-G/sparkling-water-emr H2O + AWS Lambda Tutorial: https://github.com/h2oai/app-malicious-domains