Skip to content

Commit ad8334d

Browse files
authored
Ref #gh_164 First draft of Cricket analytics using NumPy (numpy#174)
1 parent b7a17df commit ad8334d

File tree

8 files changed

+171
-10
lines changed

8 files changed

+171
-10
lines changed

config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ params:
4545
alttext: Two orbs orbiting each other. They are displacing gravity around them.
4646
url: /case-studies/gw-discov
4747
- title: Sports Analytics
48-
text: TODO!
48+
text: Cricket Analytics is changing the game by improving player and team performance through statistical modelling and predictive analytics. NumPy enables many of these analyses.
4949
img: images/content_images/case_studies/sports.jpg
5050
alttext: Cricket ball on green field.
51-
url: /
51+
url: /case-studies/cricket-analytics
52+
5253
section2:
5354
title: KEY FEATURES
5455
features:

content/en/case-studies/blackhole-image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Case Study: The First Image of a Black Hole"
33
sidebar: false
44
---
55

6-
{{< figure src="/images/content_images/cs/blackhole.jpg" caption="**Black Hole M87**" alt="black hole image" attr="(**Image Credits:** Event Horizon Telescope Collaboration)" attrlink="https://www.jpl.nasa.gov/images/universe/20190410/blackhole20190410.jpg" >}}
6+
{{< figure src="/images/content_images/cs/blackhole.jpg" caption="**Black Hole M87**" alt="black hole image" attr="*(Image Credits: Event Horizon Telescope Collaboration)*" attrlink="https://www.jpl.nasa.gov/images/universe/20190410/blackhole20190410.jpg" >}}
77

88
<blockquote cite="https://www.youtube.com/watch?v=BIvezCVcsYs">
99
<p>Imaging the M87 Black Hole is like trying to see something that is by definition impossible to see.</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---
2+
title: "Case Study: Cricket Analytics, the game changer!"
3+
sidebar: false
4+
---
5+
6+
{{< figure src="/images/content_images/cs/ipl-stadium.png"
7+
caption="**IPLT20, the biggest Cricket Festival in India**"
8+
alt="Indian Premier League Cricket cup and stadium"
9+
attr="*(Image credits: IPLT20 (cup and logo) & Akash Yadav (stadium))*"
10+
attrlink="https://unsplash.com/@aksh1802" >}}
11+
12+
<blockquote cite="https://www.scoopwhoop.com/sports/ms-dhoni/">
13+
<p>You don't play for the crowd, you play for the country.</p>
14+
<footer align="right">—M S Dhoni, <cite>International Cricket Player, ex-captain, Indian Team, plays for Chennai Super Kings in IPL</cite></footer>
15+
</blockquote>
16+
17+
## About Cricket
18+
19+
It would be an understatement to state that Indians love cricket. The game is
20+
played in just about every nook and cranny of India, rural or urban, popular
21+
with the young and the old alike, connecting billions in India unlike any other sport.
22+
Cricket enjoys lots of media attention. There is a significant amount of
23+
[money](https://www.statista.com/topics/4543/indian-premier-league-ipl/) and
24+
fame at stake. Over the last several years, technology has literally been a game
25+
changer. Audiences are spoilt for choice with streaming media, tournaments,
26+
affordable access to mobile based live cricket watching, and more.
27+
28+
The Indian Premier League (IPL) is a professional Twenty20 cricket
29+
league, founded in 2008. It is one of the most attended cricketing events in
30+
the world, valued at [$6.7 billion](https://en.wikipedia.org/wiki/Indian_Premier_League)
31+
in 2019.
32+
33+
Cricket is a game of numbers - the runs scored by a batsman, the wickets taken
34+
by a bowler, the matches won by a cricket team, the number of times a batsman
35+
responds in a certain way to a kind of bowling attack, etc. The capability to
36+
dig into cricketing numbers for both improving performance and studying
37+
the business opportunities, overall market and economics of cricket via powerful
38+
analytics tools, powered by numerical computing software such as NumPy, is a big
39+
deal. Cricket analytics provides interesting insights into the game and
40+
predictive intelligence regarding game outcomes.
41+
42+
Today, there are rich and almost infinite troves of cricket game records and
43+
statistics available, e.g., [ESPN
44+
cricinfo](https://stats.espncricinfo.com/ci/engine/stats/index.html) and
45+
[cricsheet](https://cricsheet.org). These and several such cricket databases
46+
have been used for [cricket
47+
analysis](https://www.researchgate.net/publication/336886516_Data_visualization_and_toss_related_analysis_of_IPL_teams_and_batsmen_performances)
48+
using the latest machine learning and predictive modelling algorithms.
49+
Media and entertainment platforms along with professional sports bodies
50+
associated with the game use technology and analytics for determining key
51+
metrics for improving match winning chances:
52+
53+
* batting performance moving average,
54+
* score forecasting,
55+
* gaining insights into fitness and performance of a player against different opposition,
56+
* player contribution to wins and losses for making strategic decisions on team composition
57+
58+
{{< figure src="/images/content_images/cs/cricket-pitch.png"
59+
class="csfigcaption"
60+
caption="**Cricket Pitch, the focal point in the field**"
61+
alt="A cricket pitch with bowler and batsmen"
62+
align="middle"
63+
attr="*(Image Credits: Debarghya Das)*"
64+
attrlink="http://debarghyadas.com/files/IPLpaper.pdf" >}}
65+
66+
### Key Data Analytics Objectives
67+
68+
* Sports data analytics are used not only in cricket but many [other
69+
sports](https://adtmag.com/blogs/dev-watch/2017/07/sports-analytics.aspx) for
70+
improving the overall team performance and maximize winning chances.
71+
* Real-time data analytics can help in gaining insights even during the game
72+
for changing tactics by the team and by associated businesses for economic
73+
benefits and growth.
74+
* Besides historical analysis, predictive models are
75+
harnessed to determine the possible match outcomes that require significant
76+
number crunching and data science know-how, visualization tools and capability
77+
to include newer observations in the analysis.
78+
79+
{{< figure src="/images/content_images/cs/player-pose-estimator.png"
80+
class="fig-center"
81+
alt="pose estimator"
82+
caption="**Cricket Pose Estimator**"
83+
attr="*(Image Credits: connect.vin)*"
84+
attrlink="https://connect.vin/2019/05/ai-for-cricket-batsman-pose-analysis/" >}}
85+
86+
### The Challenges
87+
88+
* **Data Cleaning and preprocessing**
89+
90+
IPL has expanded cricket beyond the classic test match format to a much
91+
larger scale. The number of matches played every season across various
92+
formats has increased and so has the data, the algorithms, newer sports data
93+
analysis technologies and simulation models. Cricket data analysis requires
94+
field mapping, player tracking, ball tracking, player shot analysis and
95+
several other aspects involved in how the ball is delivered, its angle, spin,
96+
velocity and trajectory. All these factors together have increased the
97+
complexity of data cleaning and preprocessing.
98+
99+
* **Dynamic Modeling**
100+
101+
In cricket, just like any other sport,
102+
there can be a large number of variables related to tracking various numbers
103+
of players on the field, their attributes, the ball and several possibilities
104+
of potential actions. The complexity of data analytics and modeling is
105+
directly proportional to the kind of predictive questions that are put forth
106+
during analysis and are highly dependent on data representation and the
107+
model. Things get even more challenging in terms of computation, data
108+
comparisons when dynamic cricket play predictions are sought such as what
109+
would have happened if the batsman had hit the ball at a different angle or
110+
velocity.
111+
112+
* **Predictive Analytics Complexity**
113+
114+
Much of the decision making in Cricket is based on questions such as "how
115+
often does a batsman play a certain kind of shot if the ball delivery is of a
116+
particular type", or "how does a bowler change his line and length if the
117+
batsman responds to his delivery in a certain way".
118+
This kind of predictive analytics query requires highly granular dataset
119+
availability and the capability to synthesize data and create generative
120+
models that are highly accurate.
121+
122+
## NumPy’s Role in Cricket Analytics
123+
124+
Sports Analytics is a thriving field. Many researchers and companies
125+
[use NumPy](https://adtmag.com/blogs/dev-watch/2017/07/sports-analytics.aspx)
126+
and other PyData packages like Scikit-learn, SciPy, Matplotlib, and Jupyter.
127+
in addition to latest machine learning and AI techniques. NumPy has been used
128+
for various kinds of cricket related sporting analytics such as:
129+
130+
* **Statistical Analysis:** NumPy's numerical capabilities help estimate the
131+
statistical significance of observational data or match events in the context
132+
of various player and game tactics, estimating the game outcome by comparison
133+
with a generative or static model.
134+
[Causal analysis](https://amplitude.com/blog/2017/01/19/causation-correlation)
135+
and [big data approaches](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4996805/)
136+
are used for tactical analysis.
137+
138+
* **Data Visualization:** Data graphing and [visualization](https://towardsdatascience.com/advanced-sports-visualization-with-pandas-matplotlib-and-seaborn-9c16df80a81b)
139+
provides useful insights into relationship between various datasets.
140+
141+
## Summary
142+
143+
Sports Analytics have changed the way professional games are played, especially
144+
regarding decision making which was until recently primarily done based on
145+
“gut feeling" or adherence to past traditions. NumPy forms a
146+
solid foundation for a large set of Python packages which provide higher level
147+
functions related to data analytics, machine learning and AI algorithms. These
148+
packages are widely deployed to gain real-time insights that help in decision
149+
making for game-changing outcomes, both on field as well as to draw inferences
150+
and drive business around the game of cricket. Finding out the hidden
151+
parameters, patterns and attributes that lead to the outcome of a cricket match
152+
helps the stakeholders to take notice of game insights that are otherwise hidden
153+
in numbers and statistics.
154+
155+
{{< figure src="/images/content_images/cs/numpy_ca_benefits.png"
156+
class="fig-center"
157+
alt="Diagram showing benefits of using NumPy for cricket analytics"
158+
caption="**Key NumPy Capabilities utilized**" >}}

content/en/case-studies/gw-discov.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Case Study: Discovery of Gravitational Waves"
33
sidebar: false
44
---
55

6-
{{< figure src="/images/content_images/cs/gw_sxs_image.png" class="fig-center" caption="**Gravitational Waves**" alt="binary coalesce black hole generating gravitational waves" attr="(**Image Credits: The Simulating eXtreme Spacetimes (SXS) Project at LIGO** )" attrlink="https://youtu.be/Zt8Z_uzG71o" >}}
6+
{{< figure src="/images/content_images/cs/gw_sxs_image.png" class="fig-center" caption="**Gravitational Waves**" alt="binary coalesce black hole generating gravitational waves" attr="*(Image Credits: The Simulating eXtreme Spacetimes (SXS) Project at LIGO)*" attrlink="https://youtu.be/Zt8Z_uzG71o" >}}
77

88
<blockquote cite="https://www.youtube.com/watch?v=BIvezCVcsYs">
99
<p>The scientific Python ecosystem is critical infrastructure for the research done at LIGO.</p>
@@ -45,12 +45,13 @@ made from warped spacetime.
4545
astrophysics, cosmology, particle physics, and nuclear physics.
4646
* Crunch observed data via numerical relativity computations that involves
4747
complex maths in order to discern signal from noise, filter out relevant
48-
signal and statistically estimate significance of observed data
48+
signal and statistically estimate significance of observed data
4949
* Data visualization so that the binary / numerical results can be
5050
comprehended.
51-
5251

53-
### The Challenges
52+
53+
54+
### The Challenges
5455

5556
* **Computation**
5657

@@ -61,7 +62,7 @@ made from warped spacetime.
6162
complex relativity equations and huge amounts of data which present a
6263
computational challenge:
6364
[O(10^7) CPU hrs needed for binary merger analyses](https://youtu.be/7mcHknWWzNI)
64-
spread on 6 dedicated LIGO clusters
65+
spread on 6 dedicated LIGO clusters
6566

6667
* **Data Deluge**
6768

@@ -89,7 +90,7 @@ made from warped spacetime.
8990
{{< figure src="/images/content_images/cs/gw_strain_amplitude.png" class="fig-center" alt="gravitational waves strain amplitude" caption="**Estimated gravitational-wave strain amplitude from GW150914**" attr="(**Graph Credits:** Observation of Gravitational Waves from a Binary Black Hole Merger, ResearchGate Publication)" attrlink="https://www.researchgate.net/publication/293886905_Observation_of_Gravitational_Waves_from_a_Binary_Black_Hole_Merger" >}}
9091

9192
## NumPy’s Role in the detection of Gravitational Waves
92-
93+
9394
Gravitational waves emitted from the merger cannot be computed using any
9495
technique except brute force numerical relativity using supercomputers.
9596
The amount of data LIGO collects is as incomprehensibly large as gravitational
@@ -111,13 +112,14 @@ speed. Here are some examples:
111112
* Visualization of data
112113
- Time series
113114
- Spectrograms
114-
* Compute Correlations
115+
* Compute Correlations
115116
* Key [Software](https://github.com/lscsoft) developed in GW data analysis
116117
such as [GwPy](https://gwpy.github.io/docs/stable/overview.html) and
117118
[PyCBC](https://pycbc.org) uses NumPy and AstroPy under the hood for
118119
providing object based interfaces to utilities, tools and methods for
119120
studying data from gravitational-wave detectors.
120121

122+
121123
## Summary
122124

123125
GW detection has enabled researchers to discover entirely unexpected phenomena
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)