Cricket analytics with cricketr
Cricket analytics with cricketr
Analysis of performances of cricketrs with R package cricketr
About the Book
This book contains a collection of articles that perform detailed analyis of cricketing legends past and present. The analyses have been done using my R package called cricketr (which I authored) , now available in CRAN. Details of how to use this package are included in the book. This R package is now in CRAN and uses the data from ESPN Cricinfo Statsguru. Analysis can be performed for Test, ODI and Twenty20 matches for both batsman and bowlers
Table of Contents
Preface..................................................................................................................................... 5
1. Cricket Analytics with cricketr....................................................................................... 6
1.1. Introducing cricketr! : An R package to analyze performances of cricketers......... 6
1.1.1. Introduction...................................................................................................... 6
1.1.2. The cricketr package........................................................................................ 7
1.1.3. Sachin Tendulkar’s performance – Basic Analyses........................................ 8
1.1.4. More analyses................................................................................................... 9
1.1.5. 3D scatter plot and prediction plane.............................................................. 10
1.1.6. Average runs at different venues................................................................... 11
1.1.7. Average runs against different opposing teams............................................. 12
1.1.8. Highest Runs Likelihood................................................................................ 13
1.1.9. A look at the Top 4 batsman – Tendulkar, Kallis, Ponting and Sangakkara. 14
1.1.10. Box Histogram Plot........................................................................................ 15
1.1.11. Contribution to won and lost matches........................................................... 18
1.1.12. Performance at home and overseas................................................................ 19
1.1.13. Relative Mean Strike Rate plot...................................................................... 20
1.1.14. Relative Runs Frequency plot........................................................................ 21
1.1.15. Moving Average of runs in career................................................................. 22
1.1.16. Future Runs forecast....................................................................................... 23
1.1.17. Check Batsman In-Form or Out-of-Form...................................................... 24
1.1.18. 3D plot of Runs vs Balls Faced and Minutes at Crease................................. 26
1.1.19. Predicting Runs given Balls Faced and Minutes at Crease........................... 27
1.1.20. Analysis of Top 3 wicket takers..................................................................... 28
1.1.21. Wicket Frequency Plot................................................................................... 28
1.1.22. Wickets Runs plot.......................................................................................... 29
1.1.23. Average wickets at different venues.............................................................. 30
1.1.24. Average wickets against different opposition............................................... 31
1.1.25. Relative Wickets Frequency Percentage........................................................ 32
1.1.26. Relative Economy Rate against wickets taken.............................................. 33
1.1.27. Wickets taken moving average...................................................................... 34
1.1.28. Future Wickets forecast................................................................................. 35
1.1.29. Contribution to matches won and lost........................................................... 36
1.1.30. Performance home and overseas.................................................................... 37
1.1.31. Check for bowler in-form/out-of-form.......................................................... 38
1.1.32. Key Findings................................................................................................... 39
1.1.33. Analysis of Top 4 batsman............................................................................. 40
1.1.34. Analysis of Top 3 legs spinners..................................................................... 40
Final thoughts................................................................................................................. 40
1.1.35. Batting............................................................................................................ 40
1.1.36. Bowling........................................................................................................... 41
1.2. Taking cricketr for a spin – Part 1......................................................................... 42
1.2.1. Introduction.................................................................................................... 42
1.2.2. Box Histogram Plot........................................................................................ 42
1.2.3. Relative Mean Strike Rate............................................................................. 46
1.2.4. Relative Runs Frequency Percentage............................................................. 47
1.2.5. Moving Average of runs over career............................................................. 48
1.2.6. Runs forecast.................................................................................................. 49
1.2.7. Check for batsman in-form/out-of-form........................................................ 50
1.2.8. 3D plot of Runs vs Balls Faced and Minutes at Crease................................. 51
1.2.9. Predicting Runs given Balls Faced and Minutes at Crease........................... 53
1.2.10. Contribution to matches won and lost........................................................... 54
1.2.11. Home and overseas performance................................................................... 55
1.2.12. Average runs at ground and against opposition............................................. 56
1.2.13. Key findings................................................................................................... 60
1.2.14. Final thoughts................................................................................................. 61
1.3. cricketr digs the Ashes!.......................................................................................... 62
1.3.1. Introduction.................................................................................................... 62
1.3.2. Analyses of Batsmen...................................................................................... 62
1.3.3. Box Histogram Plot........................................................................................ 62
1.3.4. Plot of 4s, 6s and the type of dismissals........................................................ 66
1.3.5. Relative Mean Strike Rate............................................................................. 70
1.3.6. Relative Runs Frequency Percentage............................................................. 71
1.3.7. Moving Average of runs over career............................................................. 72
1.3.8. Runs forecast.................................................................................................. 73
1.3.9. 3D plot of Runs vs Balls Faced and Minutes at Crease................................. 74
1.3.10. Predicting Runs given Balls Faced and Minutes at Crease........................... 76
1.3.11. Highest runs likelihood.................................................................................. 77
1.3.12. Average runs at ground and against opposition............................................. 80
1.3.13. Analysis of bowlers........................................................................................ 84
1.3.14. Wicket Frequency percentage........................................................................ 84
1.3.15. Wickets Runs plot.......................................................................................... 85
1.3.16. Average wickets in different grounds and opposition................................... 86
1.3.17. Relative bowling performance....................................................................... 90
1.3.18. Relative Economy Rate against wickets taken.............................................. 91
1.3.19. Moving average of wickets over career......................................................... 92
1.3.20. Wickets forecast............................................................................................. 93
1.3.21. Key findings................................................................................................... 94
1.4. cricketr plays the ODIs!......................................................................................... 95
1.4.1. Introduction.................................................................................................... 95
1.4.2. Plot of 4s, 6s and the scoring rate in ODIs..................................................... 96
1.4.3. Relative Mean Strike Rate........................................................................... 100
1.4.4. Relative Runs Frequency Percentage........................................................... 101
1.4.5. Percentage of 4s,6s in the runs scored......................................................... 102
1.4.6. Percent 4’s,6’s in total runs scored.............................................................. 102
1.4.7. Runs forecast................................................................................................ 103
1.4.8. 3D plot of Runs vs Balls Faced and Minutes at Crease............................... 104
1.4.9. Predicting Runs given Balls Faced and Minutes at Crease......................... 106
1.4.10. Highest runs likelihood................................................................................ 107
1.4.11. Average runs at ground and against opposition........................................... 110
1.4.12. Moving Average of runs over career........................................................... 114
1.4.13. Check batsmen in-form, out-of-form........................................................... 115
1.4.14. Analysis of bowlers...................................................................................... 116
1.4.15. Wicket Frequency percentage...................................................................... 116
1.4.16. Wickets Runs plot........................................................................................ 117
1.4.17. Average wickets in different grounds and opposition................................. 118
1.4.18. Relative bowling performance..................................................................... 122
1.4.19. Relative Economy Rate against wickets taken............................................ 123
1.4.20. Moving average of wickets over career....................................................... 124
1.4.21. Wickets forecast........................................................................................... 125
1.4.22. Check bowler in-form, out-of-form............................................................. 126
1.4.23. Key findings................................................................................................. 127
1.5. cricketr adapts to the Twenty20 International!.................................................... 129
1.5.1. Introduction.................................................................................................. 129
1.5.2. Analyses of Batsmen.................................................................................... 130
1.5.3. Plot of 4s, 6s and the scoring rate in ODIs................................................... 130
1.5.4. Relative Mean Strike Rate........................................................................... 134
1.5.5. Relative Runs Frequency Percentage........................................................... 135
1.5.6. Percent 4’s,6’s in total runs scored.............................................................. 136
1.5.7. 3D plot of Runs vs Balls Faced and Minutes at Crease............................... 137
1.5.8. Predicting Runs given Balls Faced and Minutes at Crease......................... 139
1.5.9. Highest runs likelihood................................................................................ 140
1.5.10. Moving Average of runs over career........................................................... 143
1.5.11. Analysis of bowlers...................................................................................... 144
1.5.12. Wicket Frequency percentage...................................................................... 144
1.5.13. Wickets Runs plot........................................................................................ 145
1.5.14. Relative bowling performance..................................................................... 148
1.5.15. Relative Economy Rate against wickets taken............................................ 149
1.5.16. Relative Wicket Rate.................................................................................... 150
1.5.17. Key findings................................................................................................. 152
1.5.18. Twenty 20 batsmen....................................................................................... 152
1.5.19. Twenty20 bowlers........................................................................................ 153
1.5.20. Key takeaways.............................................................................................. 153
1.6. Sixer – R package cricketr’s new Shiny avatar................................................... 154
1.6.1. Analyze batsman.......................................................................................... 154
1.6.2. Analyze bowler............................................................................................. 154
1.6.3. Relative performances of batsman............................................................... 155
1.6.4. Relative performances of bowlers............................................................... 155
1.6.5. Check for In-Form status of players............................................................ 155
1.6.6. Analyze batsman tab.................................................................................... 155
1.6.7. Analyze bowler tab....................................................................................... 157
1.6.8. Relative performance of batsmen (select more than 1)............................... 158
1.6.9. Relative performance of bowlers (select more than 1)............................... 159
1.6.10. Check in-form status of players................................................................... 161
2. Other cricket posts in R............................................................................................ 163
2.1. Analyzing cricket’s batting legends – Through the mirage with R..................... 163
2.2. Mirror, mirror … the best batsman of them all?................................................. 189
3. Appendix...................................................................................................................... 203
Cricket analysis with Machine Learning using Octave................................................. 203
3.1. Informed choices through Machine Learning – Analyzing Kohli, Tendulkar and Dravid........................................................................................................................ 204
3.2. Informed choices through Machine Learning-2 Pitting together Kumble, Kapil, Chandra.................................................................................................................. 215
Other books by this author
Authors have earned$10,052,337writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Digital-First Events
Joep Piscaer and Jana BorutaThe only resource you will ever need to launch your digital events program.
Algebra-Driven Design
Sandy MaguireA how-to field guide on building leak-free abstractions and algebraically designing real-world applications.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Continuous Delivery Pipelines
Dave FarleyThis practical handbook provides a step-by-step guide for you to get the best continuous delivery pipeline for your software.
Cloud Strategy
Gregor Hohpe“Strategy is the difference between making a wish and making it come true.” A successful migration to the cloud can transform your organization, but it shouldn’t be driven by wishes. This book tells you how to develop a sound strategy guided by frameworks and decision models without being overly abstract nor getting lost in product details.
node-opcua by example
Etienne RossignonGet the best out of node-opcua through a set of documented examples by the author himself that will allow you to create stunning OPCUA Servers or Clients.
Technical leadership and the balance with agility
Simon BrownA developer-friendly, practical and pragmatic guide to lightweight software architecture, technical leadership and the balance with agility.
Everyday Rails - RSpecによるRailsテスト入門
Junichi Ito (伊藤淳一), AKIMOTO Toshiharu, 魚振江, and Aaron SumnerRSpecを使ってRailsアプリケーションに信頼性の高いテストを書く実践的なアドバイスを提供します。詳細で丁寧な説明は本書のオリジナルコンテンツです。また、説明には実際に動かせるサンプルアプリケーションも使用します。本書は2017年版にアップデートされ、RSpec 3.6やRails 5.1といった新しい環境に対応しています!さあ、自信をもってテストできるようになりましょう!
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #3
Modern C++ by Nicolai Josuttis
2 Books
- #4
Django for Beginners/APIs/Professionals
3 Books
- #5
Modern Management Made Easy
3 Books
Read all three Modern Management Made Easy books. Learn to manage yourself, lead and serve others, and lead the organization. - #6
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #7
Mastering Containers
2 Books
Docker and Kubernetes are taking the world by storm! These books will get you up-to-speed fast! Docker Deep Dive is over 400 pages long, and covers all objectives on the Docker Certified Associate exam.The Kubernetes Book includes everything you need to get up and running with Kubernetes! - #8
The Python Craftsman
3 Books
The Python Craftsman series comprises The Python Apprentice, The Python Journeyman, and The Python Master. The first book is primarily suitable for for programmers with some experience of programming in another language. If you don't have any experience with programming this book may be a bit daunting. You'll be learning not just a programming... - #9
CCDE Practical Studies (All labs)
3 Books
CCDE lab - #10
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité...