Modern cricket game generates a lot of statistical and user-generated data. This information is used by coaches & performance analysts to devise strategies for future games and scout for new talents. In this article, I have visualized data from a recently concluded Indian Premier League (IPL) T20 game using Seaborn and Matplotlib libraries. The motivation of this exercise is to explore and understand the various data points and identify different features for possible machine learning use cases.
现代板球游戏会生成大量统计数据和用户生成的数据。 教练和绩效分析人员将使用此信息来设计未来比赛的策略并寻找新人才。 在本文中,我使用Seaborn和Matplotlib库可视化了最近结束的印度超级联赛(IPL) T20游戏的数据。 该练习的目的是探索和理解各种数据点,并为可能的机器学习用例确定不同的功能。
数据集 (Dataset)
I used publicly available data from https://www.espncricinfo.com for the IPL 2020 season opener — Mumbai Indians (MI) vs Chennai Super Kings (CSK) @ Abu Dhabi on Sep 19, 2020.
我使用了来自https://www.espncricinfo.com的公开数据作为2020年IPL揭幕战的冠军-2020年9月19日在阿布扎比的孟买印第安人(MI)对金奈超级国王(CSK) 。
为什么? (Why?)
I’m an ardent fan of Chennai Super Kings and CSK vs MI is the fierce battle in IPL with an enormous fan following for both the teams worldwide. Its the “El Clásico” of IPL, Liverpool vs Man United of the IPL, and MS Dhoni aka “ Thala” & “Captain Cool” is the Steven Gerrard of CSK.
我是Chennai Super Kings的热心粉丝,CSK vs MI在IPL上展开了激烈的战斗,全世界的这支队伍都受到了巨大的粉丝关注。 它是IPL的“ ElClásico”,IPL的利物浦vs曼联,以及MS Dhoni又名“ Thala”和“ Captain Cool”,是CSK的Steven Gerrard。
让我们玩 (Let’s Play)
条形图,计数图和分布图(Bar, Count, and Distribution Plots)
First, let’s look at runs scored by both the teams using bar and count plots.
首先,让我们看一下两个团队使用条形图和计数图获得的得分。
The first two plots show runs per over and the next two plots show the kinds of runs scored by each team. The count plot (kinds of runs) and distribution plot do indicate that both the innings had similar types of scoring with few little variations. However, the Bar plot (Runs per over) depicts an important contrast between the two innings. MI had a blasting initial overs of power play followed by declining innings, Whereas CSK had a troubling power play and picked up steam from the end of power play (after 6 overs) and maintained a steady pace till the end of the game.
前两个图显示了每次比赛的跑动,而后两个图显示了每个团队得分的跑动类型。 计数图(奔跑的种类)和分布图的确表明两个局都有相似的得分类型,几乎没有什么变化。 但是,条形图(每遍)显示了两局之间的重要对比。 MI在最初的强力游戏过分**,随后是局数下降,而CSK的强力游戏令人烦恼,并且从强力游戏结束(6次过激)后开始蒸蒸日上,并保持稳定的节奏直到比赛结束。
线图 (Line plots)
The next set of line plots show the progress of the game from start to finish (from over 1 to 20)
下一组线图显示了游戏从头到尾的进度(从1到20)
The major inference from these plots is that though CSK’s total score was less than that of MI’s until towards the end, they were scoring at a much higher rate as the game progressed as opposed to MI whose scoring rate was declining (thanks to great bowling performance of CSK marshaled by the captain MSD). It’s evident that CSK accelerated their scoring during death overs (as usual!) and went past MI at the end (as indicated in the second and third line plots above)
这些图的主要推论是,尽管直到结束时CSK的总得分都低于MI的得分,但随着比赛的进行,他们的得分要高得多,而MI的得分率却在下降(这要归功于出色的保龄球表现)由MSD机长封送的CSK)。 显然,CSK在死亡期间(如往常一样)加速了得分,并最终超过了MI(如以上第二和第三条线所示)
热图 (Heat maps)
Let’s visualize the Batsman vs Bowler performance using heat maps.
让我们使用热图可视化蝙蝠侠和鲍勒的表现。
小提琴图 (Violin Plots)
Let’s look at the distribution of runs scored by each batsman against specific bowling attack viz. Pace and Spin using violin plots
让我们看看每个击球手针对特定的保龄球进攻得分的奔跑分布。 使用小提琴图进行步调和旋转
返回条形图 (Back to Bar Plots)
Now let’s look at the total runs scored by each batsman against specific bowling attack viz. Pace and Spin
现在,让我们看看每个击球手针对特定保龄球进攻得分的总得分。 节奏与旋转
更多热图 (More Heat Maps)
The following heat maps provide a detailed visual representation of CSK’s bowling performance.
以下热图提供了CSK保龄球性能的详细可视化表示。
还有更多热图! (And more heat maps!)
散点图 (Scatter plots)
Scatter plots are useful to understand who were scoring at different parts of the innings and how many runs were they scoring. As we can see below, MI batsmen were scoring more boundaries during power play (beginning of their innings) whereas CSK batsmen were scoring more boundaries towards the end of their innings (death overs).
散点图有助于了解谁在局的不同部分得分,以及它们在多少局得分。 从下面我们可以看到,MI蝙蝠侠在力量竞赛(局开始)中得分更高,而CSK蝙蝠侠在局末(死亡局)得分更高。
The above scatter plot shows the way Ambati Rayudu and Faf du Plessis constructed their innings by rotating strikes, taking calculated risks to score boundaries to keep up with the required run rate as the game progressed — Visualization of the great partnership that they put on.
上面的散点图显示了Ambati Rayudu和F af du Plessis通过轮换罢工来构造自己的局面的方式,并根据计算的风险为边界划定了分数,以随着比赛的进行而跟上所需的奔跑速度-可视化了他们建立的良好伙伴关系。
词云 (Word Cloud)
Finally, let’s look at the word cloud representation of user comments shown in www.espncricinfo.com scorecard during the game. It summaries the game nicely and fairly echoes the performances & public sentiments
最后,让我们看一下游戏期间www.espncricinfo.com计分卡中显示的用户评论的词云表示形式。 它很好地总结了游戏,并公平地反映了表演和公众情绪
接下来是什么? (What next?)
It’s a wonderful experience to watch CSK play this year amid COVID situations. Even delightful to see MSD leading this great franchise and doing what he does best. Playing with this data, helped me to relive the great game while exploring the aspects of data visualization and sports analytics. Further work can be done to develop the dataset and build machine learning models to predict various data points impacting the game and even the outcome of the game. More to come…
在COVID情况下,今年观看CSK比赛是一次很棒的经历。 看到MSD领导这个伟大的球队并做他最擅长的事情,他感到非常高兴。 处理这些数据,帮助我重温了精彩的游戏,同时探索了数据可视化和体育分析的各个方面。 可以做进一步的工作来开发数据集并建立机器学习模型,以预测影响游戏乃至游戏结果的各种数据点。 还有更多…
翻译自: https://towardsdatascience.com/watch-a-cricket-game-through-seaborn-and-matplotlib-7047c82b380