SlideShare a Scribd company logo
1 of 15
Download to read offline
Basic H2O for
Python
Eric C. Eckstrand
Agenda
1. Getting H2O & Documentation
2. Basic Architecture
3. Loading Data
4. Data Exploration & Munging
5. Model Building
6. Model Saving & Loading
Getting H2O & Docs
1. pip install h2o
2. http://h2o.ai/download/
a. Bleeding Edge (link)
b. Install in Python (tab)
c. pip install http://h2o-release.s3.amazonaws.
com/h2o/master/3066/Python/h2o-3.1.0.3066-py2.py3-none-any.whl
3. build h2o (https://github.com/h2oai/h2o-3#4-building-h2o-3)
a. pip install h2o-py/dist/h2o-3.1.0.99999-py2.py3-none-any.whl
4. http://docs.h2o.ai/ -> H2O 3.0 -> Python Users (link) -> Python docs (link)
Basic Architecture
local machine
Python
>>> import h2o
Basic Architecture
local machine
Python
>>> import h2o
>>> h2o.init()
H2O JVM
ip=localhost, port=54321
Basic Architecture
local machine
Python
>>> import h2o
>>> h2o.init(ip=”172.16.2.181”, port=54321)
H2O JVM
ip=172.16.2.181, port=54321
remote machine
Basic Architecture
local machine
Python
>>> import h2o
>>> h2o.init(ip=”172.16.2.181”, port=54321) H2O JVM
H2O JVM
H2O JVM
H2O JVM
H2O JVM
Load Data into H2O JVM
1. Iris dataset
a. 150 rows x 5 columns
b. Sepal Width, Sepal Length, Petal Width, Petal
Length, and Species (Verginica, Setosa, Versicolor)
2. Methods
a. h2o.upload_file
b. h2o.import_frame
c. h2o.H2OFrame
Load Data into H2O JVM
my laptop: /Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv
Python
>>> import h2o
>>> h2o.init()
>>> iris_H2OFrame = h2o.upload_file
(“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”)
>>> iris_H2OFrame = h2o.import_frame
(“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”)
H2O JVM
ip=localhost, port=54321
Load Data into H2O JVM
my laptop: /Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv
Python
>>> import h2o
>>> h2o.init(ip=”172.16.2.181”, port=54321)
>>>
>>> iris_H2OFrame = h2o.upload_file
(“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”)
>>>
>>> iris_H2OFrame = h2o.import_frame
(“/home/eric/iris.csv”)
H2O JVM
ip=172.16.2.181, port=54321
server room: /home/eric/iris.csv
Exploration & Munging
my laptop: /Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv
Python
>>> import h2o
>>> h2o.init()
>>> iris_H2OFrame = h2o.upload_file
(“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”)
H2O JVM
ip=localhost, port=54321Frame
150 x 5
Exploration & Munging
1. show, dim, nrow, ncol, head, tail, col_names, setNames
2. indexing
3. summary statistics
a. mean, median, min, max, sd
4. categorical columns
a. levels
5. cut, group_by
6. ndarray <-> DataFrame <-> H2OFrame
Model-Building
1. H2O K-means
a. h2o_model = h2o.kmeans(x=iris_H2OFrame[:,0:4],
k=3)
b. h2o_model.centers()
2. Scikit Learn
a. from sklearn.cluster import KMeans
b. sk_model = KMeans(n_clusters=3)
c. sk_model.fit(iris_DataFrame.iloc[:,0:4])
d. sk_model.cluster_centers_
Model Saving & Loading
1. path = h2o.save_model(h2o_model,"
/Users/ece/")
2. saved_model = h2o.load_model(str(path))
3. saved_model.centers()
Questions?

More Related Content

What's hot

Eat my data
Eat my dataEat my data
Eat my data
Peng Zuo
 

What's hot (19)

Pyspark
PysparkPyspark
Pyspark
 
Tracing python applications
Tracing python applicationsTracing python applications
Tracing python applications
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developers
 
A brand new documentation infrastructure for the GStreamer framework (GStream...
A brand new documentation infrastructure for the GStreamer framework (GStream...A brand new documentation infrastructure for the GStreamer framework (GStream...
A brand new documentation infrastructure for the GStreamer framework (GStream...
 
OpenStack for Centos
OpenStack for CentosOpenStack for Centos
OpenStack for Centos
 
git. WTF is it doing anyway?
git. WTF is it doing anyway?git. WTF is it doing anyway?
git. WTF is it doing anyway?
 
Avoiding Performance Potholes: Scaling Python for Data Science Using Apache ...
 Avoiding Performance Potholes: Scaling Python for Data Science Using Apache ... Avoiding Performance Potholes: Scaling Python for Data Science Using Apache ...
Avoiding Performance Potholes: Scaling Python for Data Science Using Apache ...
 
R sharing 101
R sharing 101R sharing 101
R sharing 101
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 
Git operation 101
Git operation 101Git operation 101
Git operation 101
 
Installing GravCMS
Installing GravCMSInstalling GravCMS
Installing GravCMS
 
Contributing to an os project
Contributing to an os projectContributing to an os project
Contributing to an os project
 
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your applicationSpatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
 
Eat my data
Eat my dataEat my data
Eat my data
 
Git training
Git trainingGit training
Git training
 
Gittalk
GittalkGittalk
Gittalk
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
 
Python setup
Python setupPython setup
Python setup
 
Essential git fu for tech writers
Essential git fu for tech writersEssential git fu for tech writers
Essential git fu for tech writers
 

Viewers also liked

H2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff ClickH2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff Click
Sri Ambati
 

Viewers also liked (20)

Building Random Forest at Scale
Building Random Forest at ScaleBuilding Random Forest at Scale
Building Random Forest at Scale
 
H2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff ClickH2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff Click
 
H2O World - Python Pipelines - Spencer Aiello
H2O World - Python Pipelines - Spencer AielloH2O World - Python Pipelines - Spencer Aiello
H2O World - Python Pipelines - Spencer Aiello
 
H2O World - Self Guiding Applications with Venkatesh Yadav
H2O World - Self Guiding Applications with Venkatesh YadavH2O World - Self Guiding Applications with Venkatesh Yadav
H2O World - Self Guiding Applications with Venkatesh Yadav
 
H2O World - Translating Advanced Analytics for Business Users - Conor Jensen
H2O World - Translating Advanced Analytics for Business Users - Conor JensenH2O World - Translating Advanced Analytics for Business Users - Conor Jensen
H2O World - Translating Advanced Analytics for Business Users - Conor Jensen
 
H2O World - Munging, modeling, and pipelines using Python - Hank Roark
H2O World - Munging, modeling, and pipelines using Python - Hank RoarkH2O World - Munging, modeling, and pipelines using Python - Hank Roark
H2O World - Munging, modeling, and pipelines using Python - Hank Roark
 
H2O World - Survey of Available Machine Learning Frameworks - Brendan Herger
H2O World - Survey of Available Machine Learning Frameworks - Brendan HergerH2O World - Survey of Available Machine Learning Frameworks - Brendan Herger
H2O World - Survey of Available Machine Learning Frameworks - Brendan Herger
 
H2O World - Quora: Machine Learning Algorithms to Grow the World's Knowledge ...
H2O World - Quora: Machine Learning Algorithms to Grow the World's Knowledge ...H2O World - Quora: Machine Learning Algorithms to Grow the World's Knowledge ...
H2O World - Quora: Machine Learning Algorithms to Grow the World's Knowledge ...
 
H2O World - Clustering & Feature Extraction on Text - Seth Redmore
H2O World - Clustering & Feature Extraction on Text - Seth RedmoreH2O World - Clustering & Feature Extraction on Text - Seth Redmore
H2O World - Clustering & Feature Extraction on Text - Seth Redmore
 
H2O World - H2O Rains with Databricks Cloud
H2O World - H2O Rains with Databricks CloudH2O World - H2O Rains with Databricks Cloud
H2O World - H2O Rains with Databricks Cloud
 
Sparkling Water Meetup 4.15.15
Sparkling Water Meetup 4.15.15Sparkling Water Meetup 4.15.15
Sparkling Water Meetup 4.15.15
 
H2O World - Building a Smarter Application - Tom Kraljevic
H2O World - Building a Smarter Application - Tom KraljevicH2O World - Building a Smarter Application - Tom Kraljevic
H2O World - Building a Smarter Application - Tom Kraljevic
 
Data & Data Alliances - Scott Mclellan
Data & Data Alliances - Scott MclellanData & Data Alliances - Scott Mclellan
Data & Data Alliances - Scott Mclellan
 
H2O World - What you need before doing predictive analysis - Keen.io
H2O World - What you need before doing predictive analysis - Keen.ioH2O World - What you need before doing predictive analysis - Keen.io
H2O World - What you need before doing predictive analysis - Keen.io
 
H2O World - Solving Customer Churn with Machine Learning - Julian Bharadwaj
H2O World - Solving Customer Churn with Machine Learning - Julian BharadwajH2O World - Solving Customer Churn with Machine Learning - Julian Bharadwaj
H2O World - Solving Customer Churn with Machine Learning - Julian Bharadwaj
 
The Joys of Clean Data with Matt Dowle
The Joys of Clean Data with Matt DowleThe Joys of Clean Data with Matt Dowle
The Joys of Clean Data with Matt Dowle
 
H2O World - A Look Under Progressive's Big Data Hood - Pawan Divakarla & Bria...
H2O World - A Look Under Progressive's Big Data Hood - Pawan Divakarla & Bria...H2O World - A Look Under Progressive's Big Data Hood - Pawan Divakarla & Bria...
H2O World - A Look Under Progressive's Big Data Hood - Pawan Divakarla & Bria...
 
Intro to H2O Machine Learning in R at Santa Clara University
Intro to H2O Machine Learning in R at Santa Clara UniversityIntro to H2O Machine Learning in R at Santa Clara University
Intro to H2O Machine Learning in R at Santa Clara University
 
Introduction to Data Science with H2O- Mountain View
Introduction to Data Science with H2O- Mountain ViewIntroduction to Data Science with H2O- Mountain View
Introduction to Data Science with H2O- Mountain View
 
H2O Deep Water - Making Deep Learning Accessible to Everyone
H2O Deep Water - Making Deep Learning Accessible to EveryoneH2O Deep Water - Making Deep Learning Accessible to Everyone
H2O Deep Water - Making Deep Learning Accessible to Everyone
 

Similar to Basic H2O for Python with Eric Eckstrand

Similar to Basic H2O for Python with Eric Eckstrand (20)

release_python_day3_slides_201606.pdf
release_python_day3_slides_201606.pdfrelease_python_day3_slides_201606.pdf
release_python_day3_slides_201606.pdf
 
How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?
 
Distributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldDistributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component world
 
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Building a data warehouse with Pentaho and Docker
Building a data warehouse with Pentaho and DockerBuilding a data warehouse with Pentaho and Docker
Building a data warehouse with Pentaho and Docker
 
Installing tensorflow object detection on raspberry pi
Installing tensorflow object detection on raspberry piInstalling tensorflow object detection on raspberry pi
Installing tensorflow object detection on raspberry pi
 
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps JourneyBadge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
 
Raspberry pi and Azure
Raspberry pi and AzureRaspberry pi and Azure
Raspberry pi and Azure
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
 
New in Plone 3.3. What to expect from Plone 4
New in Plone 3.3. What to expect from Plone 4New in Plone 3.3. What to expect from Plone 4
New in Plone 3.3. What to expect from Plone 4
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meeting
 
Porion a new Build Manager
Porion a new Build ManagerPorion a new Build Manager
Porion a new Build Manager
 
Proteus Project : Arduino programming for LED
Proteus Project : Arduino programming for LEDProteus Project : Arduino programming for LED
Proteus Project : Arduino programming for LED
 
2016/11/05: OSWDem16 workshop
2016/11/05: OSWDem16 workshop2016/11/05: OSWDem16 workshop
2016/11/05: OSWDem16 workshop
 
OpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATXOpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATX
 
[English][Test Girls] Zero to Hero: Start Test automation with Cypress
[English][Test Girls] Zero to Hero: Start Test automation with Cypress[English][Test Girls] Zero to Hero: Start Test automation with Cypress
[English][Test Girls] Zero to Hero: Start Test automation with Cypress
 

More from Sri Ambati

More from Sri Ambati (20)

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Generative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptxGenerative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptx
 
AI and the Future of Software Development: A Sneak Peek
AI and the Future of Software Development: A Sneak Peek AI and the Future of Software Development: A Sneak Peek
AI and the Future of Software Development: A Sneak Peek
 
LLMOps: Match report from the top of the 5th
LLMOps: Match report from the top of the 5thLLMOps: Match report from the top of the 5th
LLMOps: Match report from the top of the 5th
 
Building, Evaluating, and Optimizing your RAG App for Production
Building, Evaluating, and Optimizing your RAG App for ProductionBuilding, Evaluating, and Optimizing your RAG App for Production
Building, Evaluating, and Optimizing your RAG App for Production
 
Building LLM Solutions using Open Source and Closed Source Solutions in Coher...
Building LLM Solutions using Open Source and Closed Source Solutions in Coher...Building LLM Solutions using Open Source and Closed Source Solutions in Coher...
Building LLM Solutions using Open Source and Closed Source Solutions in Coher...
 
Risk Management for LLMs
Risk Management for LLMsRisk Management for LLMs
Risk Management for LLMs
 
Open-Source AI: Community is the Way
Open-Source AI: Community is the WayOpen-Source AI: Community is the Way
Open-Source AI: Community is the Way
 
Building Custom GenAI Apps at H2O
Building Custom GenAI Apps at H2OBuilding Custom GenAI Apps at H2O
Building Custom GenAI Apps at H2O
 
Applied Gen AI for the Finance Vertical
Applied Gen AI for the Finance Vertical Applied Gen AI for the Finance Vertical
Applied Gen AI for the Finance Vertical
 
Cutting Edge Tricks from LLM Papers
Cutting Edge Tricks from LLM PapersCutting Edge Tricks from LLM Papers
Cutting Edge Tricks from LLM Papers
 
Practitioner's Guide to LLMs: Exploring Use Cases and a Glimpse Beyond Curren...
Practitioner's Guide to LLMs: Exploring Use Cases and a Glimpse Beyond Curren...Practitioner's Guide to LLMs: Exploring Use Cases and a Glimpse Beyond Curren...
Practitioner's Guide to LLMs: Exploring Use Cases and a Glimpse Beyond Curren...
 
Open Source h2oGPT with Retrieval Augmented Generation (RAG), Web Search, and...
Open Source h2oGPT with Retrieval Augmented Generation (RAG), Web Search, and...Open Source h2oGPT with Retrieval Augmented Generation (RAG), Web Search, and...
Open Source h2oGPT with Retrieval Augmented Generation (RAG), Web Search, and...
 
KGM Mastering Classification and Regression with LLMs: Insights from Kaggle C...
KGM Mastering Classification and Regression with LLMs: Insights from Kaggle C...KGM Mastering Classification and Regression with LLMs: Insights from Kaggle C...
KGM Mastering Classification and Regression with LLMs: Insights from Kaggle C...
 
LLM Interpretability
LLM Interpretability LLM Interpretability
LLM Interpretability
 
Never Reply to an Email Again
Never Reply to an Email AgainNever Reply to an Email Again
Never Reply to an Email Again
 
Introducción al Aprendizaje Automatico con H2O-3 (1)
Introducción al Aprendizaje Automatico con H2O-3 (1)Introducción al Aprendizaje Automatico con H2O-3 (1)
Introducción al Aprendizaje Automatico con H2O-3 (1)
 
From Rapid Prototypes to an end-to-end Model Deployment: an AI Hedge Fund Use...
From Rapid Prototypes to an end-to-end Model Deployment: an AI Hedge Fund Use...From Rapid Prototypes to an end-to-end Model Deployment: an AI Hedge Fund Use...
From Rapid Prototypes to an end-to-end Model Deployment: an AI Hedge Fund Use...
 
AI Foundations Course Module 1 - Shifting to the Next Step in Your AI Transfo...
AI Foundations Course Module 1 - Shifting to the Next Step in Your AI Transfo...AI Foundations Course Module 1 - Shifting to the Next Step in Your AI Transfo...
AI Foundations Course Module 1 - Shifting to the Next Step in Your AI Transfo...
 
AI Foundations Course Module 1 - An AI Transformation Journey
AI Foundations Course Module 1 - An AI Transformation JourneyAI Foundations Course Module 1 - An AI Transformation Journey
AI Foundations Course Module 1 - An AI Transformation Journey
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 

Basic H2O for Python with Eric Eckstrand

  • 2. Agenda 1. Getting H2O & Documentation 2. Basic Architecture 3. Loading Data 4. Data Exploration & Munging 5. Model Building 6. Model Saving & Loading
  • 3. Getting H2O & Docs 1. pip install h2o 2. http://h2o.ai/download/ a. Bleeding Edge (link) b. Install in Python (tab) c. pip install http://h2o-release.s3.amazonaws. com/h2o/master/3066/Python/h2o-3.1.0.3066-py2.py3-none-any.whl 3. build h2o (https://github.com/h2oai/h2o-3#4-building-h2o-3) a. pip install h2o-py/dist/h2o-3.1.0.99999-py2.py3-none-any.whl 4. http://docs.h2o.ai/ -> H2O 3.0 -> Python Users (link) -> Python docs (link)
  • 5. Basic Architecture local machine Python >>> import h2o >>> h2o.init() H2O JVM ip=localhost, port=54321
  • 6. Basic Architecture local machine Python >>> import h2o >>> h2o.init(ip=”172.16.2.181”, port=54321) H2O JVM ip=172.16.2.181, port=54321 remote machine
  • 7. Basic Architecture local machine Python >>> import h2o >>> h2o.init(ip=”172.16.2.181”, port=54321) H2O JVM H2O JVM H2O JVM H2O JVM H2O JVM
  • 8. Load Data into H2O JVM 1. Iris dataset a. 150 rows x 5 columns b. Sepal Width, Sepal Length, Petal Width, Petal Length, and Species (Verginica, Setosa, Versicolor) 2. Methods a. h2o.upload_file b. h2o.import_frame c. h2o.H2OFrame
  • 9. Load Data into H2O JVM my laptop: /Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv Python >>> import h2o >>> h2o.init() >>> iris_H2OFrame = h2o.upload_file (“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”) >>> iris_H2OFrame = h2o.import_frame (“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”) H2O JVM ip=localhost, port=54321
  • 10. Load Data into H2O JVM my laptop: /Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv Python >>> import h2o >>> h2o.init(ip=”172.16.2.181”, port=54321) >>> >>> iris_H2OFrame = h2o.upload_file (“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”) >>> >>> iris_H2OFrame = h2o.import_frame (“/home/eric/iris.csv”) H2O JVM ip=172.16.2.181, port=54321 server room: /home/eric/iris.csv
  • 11. Exploration & Munging my laptop: /Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv Python >>> import h2o >>> h2o.init() >>> iris_H2OFrame = h2o.upload_file (“/Users/ece/0xdata/h2o-dev/smalldata/iris/iris.csv”) H2O JVM ip=localhost, port=54321Frame 150 x 5
  • 12. Exploration & Munging 1. show, dim, nrow, ncol, head, tail, col_names, setNames 2. indexing 3. summary statistics a. mean, median, min, max, sd 4. categorical columns a. levels 5. cut, group_by 6. ndarray <-> DataFrame <-> H2OFrame
  • 13. Model-Building 1. H2O K-means a. h2o_model = h2o.kmeans(x=iris_H2OFrame[:,0:4], k=3) b. h2o_model.centers() 2. Scikit Learn a. from sklearn.cluster import KMeans b. sk_model = KMeans(n_clusters=3) c. sk_model.fit(iris_DataFrame.iloc[:,0:4]) d. sk_model.cluster_centers_
  • 14. Model Saving & Loading 1. path = h2o.save_model(h2o_model," /Users/ece/") 2. saved_model = h2o.load_model(str(path)) 3. saved_model.centers()