SlideShare a Scribd company logo
1 of 31
Download to read offline
Prospecting and Mining
  MLB (Sports) Data
           Ryan Elmore
       rtelmore@gmail.com
         Twitter: rtelmore

          August 6, 2011
   Rocky Mountain SABR Meeting
Data Science
... And Hype
The Economist May 14-20,
2011: “Corporate chefs
are in demand again, office
rents are soaring and the
pay being offered to
talented folk in fashionable
fields like data science
is reaching Hollywood
levels.”
Not Your Typical Tech Talk
A Delayed Flight at DIA ...
Why Are The Games Boring?
Simmons Red Sox Data
Simmons Red Sox Data
A Few Thoughts ...
• The underlying data unit is in minutes. So?
• Why is he only looking at this particular set
  of year?
• How do the Red Sox compare to the other
  teams in MLB?
• Crap, that last point will require
  downloading a lot of data ... and my flight
  was boarding in 10 minutes!
Where Can We Get Data?
Where Can We Get Data?
http://www.baseball-reference.com/teams/COL/2010-schedule-scores.shtml
Where Can We Get Data?
http://www.baseball-reference.com/teams/COL/2010-schedule-scores.shtml




      Just step through
       all of the teams:
       COL, BOS, etc.
Where Can We Get Data?
http://www.baseball-reference.com/teams/COL/2010-schedule-scores.shtml




      Just step through                 and any years
       all of the teams:                 that you are
       COL, BOS, etc.                   interested in.
A Typical Website




          The Golden Nugget
Data All Teams
Another Visual Representation
Boston vs. The Rest
Are The Games Getting Longer?
 • I don’t know!
 • I would say that the evidence supports an
   increase up until 2000 and then it’s been
   constant or slightly decreasing.
 • This is not an exercise in statistical
   inference; I was just mining the data and
   looking for trends.
 • thelogcabin.wordpress.com/
 • github.com/rtelmore/MLB
Another Exercise

  • In a conversation with Paul Parker, he asked
      if the minimum number of pitches per (full)
      inning (6 pitches) has ever been attained.
  • This is a hard problem!
  • Where do you find this sort of data?
  • Back to baseball-reference.com ... the box
      scores.
http://www.baseball-reference.com/boxes/COL/COL201104010.shtml
The Boxscore Website




The Golden Nugget
How Do We Proceed?
The most systematic way that I could find
was to break it down like this:
• 30 Teams
• 2005 - 2010
• Everyday from Apr 1 through Oct 31
• This is a little more than 78K URLs!
• My program took about 3 hrs 25 min.
Was That Minimum Attained?

  • NO! Unless there is an error in my code.
  • Did we learn something? Of course.
  • Example: I should’ve stored everything in a
      database while I was downloading and
      processing the data. Why? I didn’t save any
      of the data from the 3+ hrs of computing.

http://www.baseball-reference.com/boxes/COL/COL201104010.shtml
Using Google Trends Data
• http://www.google.com/trends
• You can put a search term in and it will
  return a lot of historical statistics related to
  your query (e.g., flu trends)
• There is an R package (RGoogleTrends)
  that allows access to the GT API if you have
  a google account (e.g., gmail).
• Use the getGTrends(“query”) function
GT “Colorado Rockies”
GTrends “Colorado Rockies”
                      World Series




                      Playoff Run
Google Trends “NFL”
Google Trends “NFL”
Google Trends “NFL”
Google Trends “NFL”
Conclusions/Discussion

• There is a lot of data available on the web!
• You can access this data from a browser;
  however, you can access A LOT more data
  if you let your computer do the work.
• Good tools for data mining: R, python,
  perl, etc.
• Download data and see where you go
Resources
• thelogcabin.wordpress.com
• github.com/rtelmore
• baseball-reference.com, espn.com, Google
  Trends, etc.
• Twitter (@rtelmore)
• www.r-project.org
• www.meetup.com/DenverRUG

More Related Content

Similar to Sabr

useR! 2012 Talk
useR! 2012 TalkuseR! 2012 Talk
useR! 2012 Talkrtelmore
 
Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...
Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...
Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...News Leaders Association's NewsTrain
 
Building Analytics Infrastructure for Growing Tech Companies
Building Analytics Infrastructure for Growing Tech CompaniesBuilding Analytics Infrastructure for Growing Tech Companies
Building Analytics Infrastructure for Growing Tech CompaniesHolistics Software
 
Data mining for baseball new ppt
Data mining for baseball new pptData mining for baseball new ppt
Data mining for baseball new pptSalford Systems
 
20 questions business resources2012)
20 questions business resources2012)20 questions business resources2012)
20 questions business resources2012)LYRASIS_PRODEV
 
Tips for Doing Accurate Data Journalism
Tips for Doing Accurate Data JournalismTips for Doing Accurate Data Journalism
Tips for Doing Accurate Data JournalismCraig Silverman
 
Ben carls l_tron
Ben carls l_tronBen carls l_tron
Ben carls l_tronBen Carls
 
01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt
01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt
01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFptWrushabhShirsat3
 
Creating an Open Source Genealogical Search Engine with Apache Solr
Creating an Open Source Genealogical Search Engine with Apache SolrCreating an Open Source Genealogical Search Engine with Apache Solr
Creating an Open Source Genealogical Search Engine with Apache SolrBrooke Ganz
 
2011 simple-webinar_searchsecrets_trv_l_145_final
 2011 simple-webinar_searchsecrets_trv_l_145_final 2011 simple-webinar_searchsecrets_trv_l_145_final
2011 simple-webinar_searchsecrets_trv_l_145_finalduchess
 
BristolSEO - Technical SEO at Scale
BristolSEO - Technical SEO at ScaleBristolSEO - Technical SEO at Scale
BristolSEO - Technical SEO at ScaleHayden Roche
 
FL/AL ARVC Internet Marketing Presentation
FL/AL ARVC Internet Marketing PresentationFL/AL ARVC Internet Marketing Presentation
FL/AL ARVC Internet Marketing PresentationJohn Barron
 
A Day in the Life of a Functional Data Scientist
A Day in the Life of a Functional Data ScientistA Day in the Life of a Functional Data Scientist
A Day in the Life of a Functional Data ScientistC4Media
 
Introduction to Web Performance
Introduction to Web PerformanceIntroduction to Web Performance
Introduction to Web PerformanceSergeyChernyshev
 
Federated Ontology for Sports- Paper
Federated Ontology for Sports- PaperFederated Ontology for Sports- Paper
Federated Ontology for Sports- PaperGeorge Sam
 
Getting Insight from Big Data
Getting Insight from Big DataGetting Insight from Big Data
Getting Insight from Big DataUjang Fahmi
 
Analytics: What You Want to Know
Analytics: What You Want to KnowAnalytics: What You Want to Know
Analytics: What You Want to KnowAnthony Altieri
 
Website tips and tweaks v2
Website tips and tweaks v2Website tips and tweaks v2
Website tips and tweaks v2Joe Seanor
 
Data Journalism (City Online Journalism wk8)
Data Journalism (City Online Journalism wk8)Data Journalism (City Online Journalism wk8)
Data Journalism (City Online Journalism wk8)Paul Bradshaw
 

Similar to Sabr (20)

useR! 2012 Talk
useR! 2012 TalkuseR! 2012 Talk
useR! 2012 Talk
 
Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...
Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...
Data-driven enterprise off your beat - Doug Caruso - Columbus, Ohio, NewsTrai...
 
Building Analytics Infrastructure for Growing Tech Companies
Building Analytics Infrastructure for Growing Tech CompaniesBuilding Analytics Infrastructure for Growing Tech Companies
Building Analytics Infrastructure for Growing Tech Companies
 
Data mining for baseball new ppt
Data mining for baseball new pptData mining for baseball new ppt
Data mining for baseball new ppt
 
Searching Online
Searching OnlineSearching Online
Searching Online
 
20 questions business resources2012)
20 questions business resources2012)20 questions business resources2012)
20 questions business resources2012)
 
Tips for Doing Accurate Data Journalism
Tips for Doing Accurate Data JournalismTips for Doing Accurate Data Journalism
Tips for Doing Accurate Data Journalism
 
Ben carls l_tron
Ben carls l_tronBen carls l_tron
Ben carls l_tron
 
01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt
01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt
01_intro.pfwekfmwEKFHswfuhSWFYUGsduyfgSWY6FEWUFpt
 
Creating an Open Source Genealogical Search Engine with Apache Solr
Creating an Open Source Genealogical Search Engine with Apache SolrCreating an Open Source Genealogical Search Engine with Apache Solr
Creating an Open Source Genealogical Search Engine with Apache Solr
 
2011 simple-webinar_searchsecrets_trv_l_145_final
 2011 simple-webinar_searchsecrets_trv_l_145_final 2011 simple-webinar_searchsecrets_trv_l_145_final
2011 simple-webinar_searchsecrets_trv_l_145_final
 
BristolSEO - Technical SEO at Scale
BristolSEO - Technical SEO at ScaleBristolSEO - Technical SEO at Scale
BristolSEO - Technical SEO at Scale
 
FL/AL ARVC Internet Marketing Presentation
FL/AL ARVC Internet Marketing PresentationFL/AL ARVC Internet Marketing Presentation
FL/AL ARVC Internet Marketing Presentation
 
A Day in the Life of a Functional Data Scientist
A Day in the Life of a Functional Data ScientistA Day in the Life of a Functional Data Scientist
A Day in the Life of a Functional Data Scientist
 
Introduction to Web Performance
Introduction to Web PerformanceIntroduction to Web Performance
Introduction to Web Performance
 
Federated Ontology for Sports- Paper
Federated Ontology for Sports- PaperFederated Ontology for Sports- Paper
Federated Ontology for Sports- Paper
 
Getting Insight from Big Data
Getting Insight from Big DataGetting Insight from Big Data
Getting Insight from Big Data
 
Analytics: What You Want to Know
Analytics: What You Want to KnowAnalytics: What You Want to Know
Analytics: What You Want to Know
 
Website tips and tweaks v2
Website tips and tweaks v2Website tips and tweaks v2
Website tips and tweaks v2
 
Data Journalism (City Online Journalism wk8)
Data Journalism (City Online Journalism wk8)Data Journalism (City Online Journalism wk8)
Data Journalism (City Online Journalism wk8)
 

Recently uploaded

Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxAlbania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxWorld Wide Tickets And Hospitality
 
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxSpain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxWorld Wide Tickets And Hospitality
 
Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfLatiyalinfotech
 
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxSlovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxWorld Wide Tickets And Hospitality
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxEuro Cup 2024 Tickets
 
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyHire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyNitya salvi
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennisjocksofalltradespodc
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Sports Writing (Rules,Tips, Examples, etc)
Sports Writing (Rules,Tips, Examples, etc)Sports Writing (Rules,Tips, Examples, etc)
Sports Writing (Rules,Tips, Examples, etc)CMBustamante
 
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...Eticketing.co
 
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room packageWhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room packageNitya salvi
 
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...World Wide Tickets And Hospitality
 
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)Delhi Call girls
 
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...Nitya salvi
 
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMuzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Eticketing.co
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartChart Kalyan
 
European Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docxEuropean Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docxEuro Cup 2024 Tickets
 
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfJORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfArturo Pacheco Alvarez
 
UEFA Euro 2024 Squad Check-in Which team is Top favorite.docx
UEFA Euro 2024 Squad Check-in Which team is Top favorite.docxUEFA Euro 2024 Squad Check-in Which team is Top favorite.docx
UEFA Euro 2024 Squad Check-in Which team is Top favorite.docxEuro Cup 2024 Tickets
 

Recently uploaded (20)

Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxAlbania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
 
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxSpain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
 
Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdf
 
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxSlovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
 
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyHire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennis
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Sports Writing (Rules,Tips, Examples, etc)
Sports Writing (Rules,Tips, Examples, etc)Sports Writing (Rules,Tips, Examples, etc)
Sports Writing (Rules,Tips, Examples, etc)
 
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
 
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room packageWhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
 
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
 
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
 
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMuzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar Chart
 
European Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docxEuropean Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docx
 
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfJORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
 
UEFA Euro 2024 Squad Check-in Which team is Top favorite.docx
UEFA Euro 2024 Squad Check-in Which team is Top favorite.docxUEFA Euro 2024 Squad Check-in Which team is Top favorite.docx
UEFA Euro 2024 Squad Check-in Which team is Top favorite.docx
 

Sabr

  • 1. Prospecting and Mining MLB (Sports) Data Ryan Elmore rtelmore@gmail.com Twitter: rtelmore August 6, 2011 Rocky Mountain SABR Meeting
  • 3. ... And Hype The Economist May 14-20, 2011: “Corporate chefs are in demand again, office rents are soaring and the pay being offered to talented folk in fashionable fields like data science is reaching Hollywood levels.”
  • 4. Not Your Typical Tech Talk
  • 5. A Delayed Flight at DIA ...
  • 6. Why Are The Games Boring?
  • 9. A Few Thoughts ... • The underlying data unit is in minutes. So? • Why is he only looking at this particular set of year? • How do the Red Sox compare to the other teams in MLB? • Crap, that last point will require downloading a lot of data ... and my flight was boarding in 10 minutes!
  • 10. Where Can We Get Data?
  • 11. Where Can We Get Data? http://www.baseball-reference.com/teams/COL/2010-schedule-scores.shtml
  • 12. Where Can We Get Data? http://www.baseball-reference.com/teams/COL/2010-schedule-scores.shtml Just step through all of the teams: COL, BOS, etc.
  • 13. Where Can We Get Data? http://www.baseball-reference.com/teams/COL/2010-schedule-scores.shtml Just step through and any years all of the teams: that you are COL, BOS, etc. interested in.
  • 14. A Typical Website The Golden Nugget
  • 18. Are The Games Getting Longer? • I don’t know! • I would say that the evidence supports an increase up until 2000 and then it’s been constant or slightly decreasing. • This is not an exercise in statistical inference; I was just mining the data and looking for trends. • thelogcabin.wordpress.com/ • github.com/rtelmore/MLB
  • 19. Another Exercise • In a conversation with Paul Parker, he asked if the minimum number of pitches per (full) inning (6 pitches) has ever been attained. • This is a hard problem! • Where do you find this sort of data? • Back to baseball-reference.com ... the box scores. http://www.baseball-reference.com/boxes/COL/COL201104010.shtml
  • 20. The Boxscore Website The Golden Nugget
  • 21. How Do We Proceed? The most systematic way that I could find was to break it down like this: • 30 Teams • 2005 - 2010 • Everyday from Apr 1 through Oct 31 • This is a little more than 78K URLs! • My program took about 3 hrs 25 min.
  • 22. Was That Minimum Attained? • NO! Unless there is an error in my code. • Did we learn something? Of course. • Example: I should’ve stored everything in a database while I was downloading and processing the data. Why? I didn’t save any of the data from the 3+ hrs of computing. http://www.baseball-reference.com/boxes/COL/COL201104010.shtml
  • 23. Using Google Trends Data • http://www.google.com/trends • You can put a search term in and it will return a lot of historical statistics related to your query (e.g., flu trends) • There is an R package (RGoogleTrends) that allows access to the GT API if you have a google account (e.g., gmail). • Use the getGTrends(“query”) function
  • 25. GTrends “Colorado Rockies” World Series Playoff Run
  • 30. Conclusions/Discussion • There is a lot of data available on the web! • You can access this data from a browser; however, you can access A LOT more data if you let your computer do the work. • Good tools for data mining: R, python, perl, etc. • Download data and see where you go
  • 31. Resources • thelogcabin.wordpress.com • github.com/rtelmore • baseball-reference.com, espn.com, Google Trends, etc. • Twitter (@rtelmore) • www.r-project.org • www.meetup.com/DenverRUG