SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Intro to
Python:
Build a
Predictive
Model
Introductions
➔ What's your name?
➔ What brought you here today?
➔ What is your programming experience?
We train developers and
data scientists through
1x1 mentorship and
project-based learning.
Guaranteed.
About Thinkful
Learn
by
Doing
➔ Why is Data Science a thing?
➔ What is Python?
➔ How do we use it with a real
world project?
➔ How do I learn more?
What
is
a
Data
Scientist?
“[LinkedIn] was like arriving at a conference
reception and realizing you don’t know anyone. So
you just stand in the corner sipping your drink —
and you probably leave early.”
— LinkedIn Manager, June 2006
Example:
LinkedIn
2006
➔ Joined LinkedIn in 2006, only 8M
users (450M in 2016)
➔ Started experiments to predict
people’s networks
➔ Engineers were dismissive: “you
can already import your address
book”
Enter:
Data
Scientist
➔ Frame the question
➔ Collect the raw data
➔ Process the data
➔ Explore the data
➔ Communicate results
The
Process:
LinkedIn
Example
➔ What questions do we want to answer?
◆ Who?
◆ What?
◆ When?
◆ Where?
◆ Why?
◆ How?
Case:
Frame
the
Question
➔ What connections (type and number) lead to higher
user engagement?
➔ Which connections do people want to make but are
currently limited from making?
➔ How might we predict these types of connections with
limited data from the user?
Case:
Frame
the
Question
➔ What data do we need to
answer these questions?
Case:
Collect
the
Data
➔ Connection data (who is who connected to?)
➔ Demographic data (what is the profile of
the connection)
➔ Engagement data (how do they use the site)
Case:
Collect
the
Data
➔ How is the data
“dirty” and how can
we clean it?
Case:
Process
the
Data
➔ User input
➔ Redundancies
➔ Feature changes
➔ Data model changes
Case:
Process
the
Data
➔ What are the meaningful
patterns in the data?
Case:
Explore
the
Data
➔ Triangle closing
➔ Time Overlaps
➔ Geographic Overlaps
Case:
Explore
the Data
➔ How do we communicate this?
➔ To whom?
Case:
Communicate
Findings
➔ Marketing - sell X more ad space, results in X more
impressions per day
➔ Product - build X more features
➔ Development - grow our team by X
➔ Sales - attract X more premium accounts
➔ C-Level - more revenue, 8M - 450M in 10 years
Case:
Communicate
Findings
The
Result
Python for Programming
➔ Great for Data Science
➔ Robotics
➔ Web Development
(Python/Django)
➔ Automation
Let’s
Learn
Python
Let’s
Learn
Python
➔ Our model is going to be a Decision Tree
➔ Decision Trees predict the most likely outcome
based on input
➔ Like a computer building a version of 20
questions
The
Model
Decision
Trees:
Golf?
➔ We’ll be using a
Google-hosted Python notebook
to build this model called
Colaboratory
➔ Go to:
Colab.research.google.com
➔ Click New Python 3 Notebook
The
Notebook
from sklearn import tree
➔ Import Tree functionality from
the SKLearn Python Package
➔ bit.ly/sklearn-python
Code
Block 1
X = [[181,80], [177,70], [160,60], [154,54], [166,65],
[190,90], [175,64], [177,70], [159,55], [171,75], [181,85]]
Y = ['male','female','female','female','male','male','male','female',
'male','female','male']
➔ Load in our seed data
➔ X is an array of inputs, each input is itself
an array that contains Height (in cm) and
Weight (in kg)
➔ Y is an array of strings that map to the
inputs in X so we can train the model
Code
Block 2
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X,Y)
#print tree.export_graphviz(clf,None)
➔ We create an empty DecisionTreeClassifier and
assign it to the variable clf
➔ We fit the decision tree with our X and Y
seed data
➔ SKLearn is automatically creating our
Decision Tree questions for us (Example: Is
height > 177? Yes - Male)
➔ Uncomment the last line and paste the return
string into: webgraphviz.com
Code
Block 3
prediction = clf.predict([[183,76]])
print prediction
➔ Now we give our inputs, in the same format
➔ Height (cm), Weight (kg)
➔ Print our prediction
Code
Block 4
Our model has a few weaknesses:
➔ Limited inputs
➔ Assumptions
Shortcomings
Ways
to
Learn
Data
Science
➔ Start with Python and Statistics
➔ Personal Program Manager
➔ Unlimited Q&A Sessions
➔ Student Slack Community
➔ bit.ly/freetrial-ds
Thinkful
Two-Week
Free
Trial
The
Student
Experience
Marnie Boyer, Thinkful Graduate
Capstone
Wolfgang Hall, Thinkful Graduate
Capstone
➔ bit.ly/tf-event-feedback
Survey

Weitere ähnliche Inhalte

Ähnlich wie Tf itpbapm

Data science presentation
Data science presentationData science presentation
Data science presentationMSDEVMTL
 
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...Lviv Startup Club
 
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)Austin Ogilvie
 
Virtual Collaboration
Virtual CollaborationVirtual Collaboration
Virtual Collaborationraanan
 
Batbwjs1121
Batbwjs1121Batbwjs1121
Batbwjs1121Thinkful
 
An Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperAn Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperRishiVardhaniM
 
Data science tools of the trade
Data science tools of the tradeData science tools of the trade
Data science tools of the tradeFangda Wang
 
Tech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @CriteoTech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @CriteoGilles Legoux
 
How to Use Data Effectively by Abra Sr. Business Analyst
How to Use Data Effectively by Abra Sr. Business AnalystHow to Use Data Effectively by Abra Sr. Business Analyst
How to Use Data Effectively by Abra Sr. Business AnalystProduct School
 

Ähnlich wie Tf itpbapm (20)

Tf byow
Tf byowTf byow
Tf byow
 
Tf byow
Tf byowTf byow
Tf byow
 
Data science presentation
Data science presentationData science presentation
Data science presentation
 
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
 
Tf byows
Tf byowsTf byows
Tf byows
 
Tf byowwhc
Tf byowwhcTf byowwhc
Tf byowwhc
 
Tf byowwhc
Tf byowwhcTf byowwhc
Tf byowwhc
 
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
 
Tf itjsbagg
Tf itjsbaggTf itjsbagg
Tf itjsbagg
 
Virtual Collaboration
Virtual CollaborationVirtual Collaboration
Virtual Collaboration
 
Batbwjs1121
Batbwjs1121Batbwjs1121
Batbwjs1121
 
An Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperAn Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python Developer
 
Tf bawa
Tf bawaTf bawa
Tf bawa
 
Tf bawa
Tf bawaTf bawa
Tf bawa
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
Data science tools of the trade
Data science tools of the tradeData science tools of the trade
Data science tools of the trade
 
Tech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @CriteoTech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @Criteo
 
How to Use Data Effectively by Abra Sr. Business Analyst
How to Use Data Effectively by Abra Sr. Business AnalystHow to Use Data Effectively by Abra Sr. Business Analyst
How to Use Data Effectively by Abra Sr. Business Analyst
 
Python
PythonPython
Python
 
Batbwjs14
Batbwjs14Batbwjs14
Batbwjs14
 

Mehr von Shannon Gallagher (19)

Tf wiads
Tf wiadsTf wiads
Tf wiads
 
Tf wdvds
Tf wdvdsTf wdvds
Tf wdvds
 
Tf gsit
Tf gsitTf gsit
Tf gsit
 
Tf itjsbagg
Tf itjsbaggTf itjsbagg
Tf itjsbagg
 
Tf ffccjs
Tf ffccjsTf ffccjs
Tf ffccjs
 
Tf ffcchtmlcss
Tf ffcchtmlcssTf ffcchtmlcss
Tf ffcchtmlcss
 
Tf bawa
Tf bawaTf bawa
Tf bawa
 
Tf dsyv
Tf dsyvTf dsyv
Tf dsyv
 
Tf ffccjs
Tf ffccjsTf ffccjs
Tf ffccjs
 
Ffcchtml
FfcchtmlFfcchtml
Ffcchtml
 
Tf gsds
Tf gsdsTf gsds
Tf gsds
 
Tf ffccjs
Tf   ffccjsTf   ffccjs
Tf ffccjs
 
Tf frccjs
Tf frccjsTf frccjs
Tf frccjs
 
Tf fcchc
Tf fcchcTf fcchc
Tf fcchc
 
Bavp sd
Bavp sdBavp sd
Bavp sd
 
Den bavp
Den bavpDen bavp
Den bavp
 
Tf bavp
Tf bavpTf bavp
Tf bavp
 
Fcchc424
Fcchc424Fcchc424
Fcchc424
 
Byowwhc43
Byowwhc43Byowwhc43
Byowwhc43
 

Kürzlich hochgeladen

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 

Kürzlich hochgeladen (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

Tf itpbapm

  • 2. Introductions ➔ What's your name? ➔ What brought you here today? ➔ What is your programming experience?
  • 3. We train developers and data scientists through 1x1 mentorship and project-based learning. Guaranteed. About Thinkful
  • 4. Learn by Doing ➔ Why is Data Science a thing? ➔ What is Python? ➔ How do we use it with a real world project? ➔ How do I learn more?
  • 6. “[LinkedIn] was like arriving at a conference reception and realizing you don’t know anyone. So you just stand in the corner sipping your drink — and you probably leave early.” — LinkedIn Manager, June 2006 Example: LinkedIn 2006
  • 7. ➔ Joined LinkedIn in 2006, only 8M users (450M in 2016) ➔ Started experiments to predict people’s networks ➔ Engineers were dismissive: “you can already import your address book” Enter: Data Scientist
  • 8. ➔ Frame the question ➔ Collect the raw data ➔ Process the data ➔ Explore the data ➔ Communicate results The Process: LinkedIn Example
  • 9. ➔ What questions do we want to answer? ◆ Who? ◆ What? ◆ When? ◆ Where? ◆ Why? ◆ How? Case: Frame the Question
  • 10. ➔ What connections (type and number) lead to higher user engagement? ➔ Which connections do people want to make but are currently limited from making? ➔ How might we predict these types of connections with limited data from the user? Case: Frame the Question
  • 11. ➔ What data do we need to answer these questions? Case: Collect the Data
  • 12. ➔ Connection data (who is who connected to?) ➔ Demographic data (what is the profile of the connection) ➔ Engagement data (how do they use the site) Case: Collect the Data
  • 13. ➔ How is the data “dirty” and how can we clean it? Case: Process the Data
  • 14. ➔ User input ➔ Redundancies ➔ Feature changes ➔ Data model changes Case: Process the Data
  • 15. ➔ What are the meaningful patterns in the data? Case: Explore the Data
  • 16. ➔ Triangle closing ➔ Time Overlaps ➔ Geographic Overlaps Case: Explore the Data
  • 17. ➔ How do we communicate this? ➔ To whom? Case: Communicate Findings
  • 18. ➔ Marketing - sell X more ad space, results in X more impressions per day ➔ Product - build X more features ➔ Development - grow our team by X ➔ Sales - attract X more premium accounts ➔ C-Level - more revenue, 8M - 450M in 10 years Case: Communicate Findings
  • 20. Python for Programming ➔ Great for Data Science ➔ Robotics ➔ Web Development (Python/Django) ➔ Automation Let’s Learn Python
  • 22. ➔ Our model is going to be a Decision Tree ➔ Decision Trees predict the most likely outcome based on input ➔ Like a computer building a version of 20 questions The Model
  • 24. ➔ We’ll be using a Google-hosted Python notebook to build this model called Colaboratory ➔ Go to: Colab.research.google.com ➔ Click New Python 3 Notebook The Notebook
  • 25. from sklearn import tree ➔ Import Tree functionality from the SKLearn Python Package ➔ bit.ly/sklearn-python Code Block 1
  • 26. X = [[181,80], [177,70], [160,60], [154,54], [166,65], [190,90], [175,64], [177,70], [159,55], [171,75], [181,85]] Y = ['male','female','female','female','male','male','male','female', 'male','female','male'] ➔ Load in our seed data ➔ X is an array of inputs, each input is itself an array that contains Height (in cm) and Weight (in kg) ➔ Y is an array of strings that map to the inputs in X so we can train the model Code Block 2
  • 27. clf = tree.DecisionTreeClassifier() clf = clf.fit(X,Y) #print tree.export_graphviz(clf,None) ➔ We create an empty DecisionTreeClassifier and assign it to the variable clf ➔ We fit the decision tree with our X and Y seed data ➔ SKLearn is automatically creating our Decision Tree questions for us (Example: Is height > 177? Yes - Male) ➔ Uncomment the last line and paste the return string into: webgraphviz.com Code Block 3
  • 28. prediction = clf.predict([[183,76]]) print prediction ➔ Now we give our inputs, in the same format ➔ Height (cm), Weight (kg) ➔ Print our prediction Code Block 4
  • 29. Our model has a few weaknesses: ➔ Limited inputs ➔ Assumptions Shortcomings
  • 31. ➔ Start with Python and Statistics ➔ Personal Program Manager ➔ Unlimited Q&A Sessions ➔ Student Slack Community ➔ bit.ly/freetrial-ds Thinkful Two-Week Free Trial
  • 32. The Student Experience Marnie Boyer, Thinkful Graduate Capstone Wolfgang Hall, Thinkful Graduate Capstone