Advaita
  • Home
  • About

IPL Data Visualization and Machine learningBeta

We love cricket, in fact our earlier mobile app was on unique cricket facts. If you are interested you can try the free app available on android, iphone.

Various tools used are

Jupyter
Pandas
Numpy
Matplotlib
Seaborn
Keras
TF 2.0
Flourish

Today's modern data visualization tools give Deep insights on Data with easy generation of stats and graphs.
For this project we have used IPL data available on google from 2008 to 2019 (data upto 16-April-2019).
Few Analytics captured via data are

Team Winning Year
Rajasthan Royals 2008
Deccan Chargers 2009
Chennai Super Kings 2010 2011 2018
Kolkata Knight Riders 2012 2014
Mumbai Indians 2013 2015 2017
Sunrisers Hyderabad 2016
Team Total Runs 2008-2019 % of Total Runs
Chennai Super Kings 24948 11.11
Deccan Chargers 11464 5.1
Delhi Capitals 25486 11.35
Gujarat Lions 4856 2.16
Kings XI Punjab 26785 11.93
Kochi Tuskers Kerala 1877 0.84
Kolkata Knight Riders 26078 11.61
Mumbai Indians 28466 12.68
Pune Warriors India 10897 4.85
Rajasthan Royals 21372 9.52
Royal Challengers Bangalore 26749 11.91
Sunrisers Hyderabad 15596 6.94
Team Total Wickets 2008-2019 % of Total Wickets
Chennai Super Kings 161 10.07
Deccan Chargers 76 5.05
Delhi Capitals 173 11.5
Gujarat Lions 30 1.99
Kings XI Punjab 172 11.44
Kochi Tuskers Kerala 14 0.93
Kolkata Knight Riders 181 12.03
Mumbai Indians 183 12.17
Pune Warriors India 76 5.05
Rajasthan Royals 149 9.91
Royal Challengers Bangalore 182 12.1
Sunrisers Hyderabad 107 7.11
Team Toss (W/L) Match Total
Chennai Super Kings Win Lost 29
Win 54
Deccan Chargers Win Lost 24
Win 19
Delhi Capitals Win Lost 44
Win 36
Gujarat Lions Win Lost 5
Win 10
Kings XI Punjab Win Lost 46
Win 32
Kochi Tuskers Kerala Win Lost 4
Win 4
Kolkata Knight Riders Win Lost 35
Win 52
Mumbai Indians Win Lost 42
Win 53
Pune Warriors India Win Lost 21
Win 12
Royal Challengers Bangalore Win Lost 34
Win 42
Sunrisers Hyderabad Win Lost 23
Win 21

When we use Seaborn against our data. It gives some intresting graphs.

Below code shows matches played per year including home/away/neutral

ax = sns.countplot(x='Year', data=dataset)
plt.show()

If you want to see Man Of The Match from Each Team across all seasons.
Mumbai ranks first followed by Royal Challengers Bangalore.

ax= sns.countplot(x='ManoftheMatchTeam', data= dataset)
plt.show()

With Similar charts you can get
1. Wins Per Season by teams
2. Individual Stats ( MOM awards and total runs at each positions )
3. Wickets taken
4. View progress per season

Machine Learning

We have used 2 models to generate prediction on runs scored per match by team using TF 2.0.

First Model contains 23 Featured columns (Team, Ground, Match Type (Q/S/F), Home/Away, Toss, Batting First, Batting Second, Match Time, Runs Scored, Wickets Taken, Batting Run Rate, Bowling Run Rate, Man Of The Match and more)

Second model is with 170 + Columns and will update this blog once our ML training is complete.

Current prediction listed below is in beta mode and only for educational purpose. We will update this page with further research and reports.

Reason we have launched it in beta is that, we think this model can be made more accurate and we need your inputs and feedback. If you have suggestions please do share with us advaita@rachittechnology.com

We have used Supervised Machine Learning optimized for RMSE. Current model contains 23 Featured Columns and 1476 rows. We believe Model Evaluation will improve with more data and number of rows.

MAE(Mean absolute error) 2.021
RMSE(Root Mean Square Error) 2.737
R squared (R^2) 0.994
MAPE(Mean absolute percentage error) 1.35%


*Below prediction is based on data till 16-April-2019. Model and prediction is generated on 16-April-2019.

Prediction
Team Date Runs Lost Toss Runs Win Toss Actual
CSK 17-Apr 176 204 132
SRH 17-Apr 170 197 137
DC 18-Apr 195 224 128
MI 18-Apr 173 200 168
KKR 19-Apr 187 215 203
RCB 19-Apr 166 193 213
DC 20-Apr 192 220 166
KXIP 20-Apr 175 203 163
MI 20-Apr 175 202 161
RR 20-Apr 185 213 162
CSK 21-Apr 174 202 160
KKR 21-Apr 177 204 159
RCB 21-Apr 170 197 161
SRH 21-Apr 181 209 161
DC 22-Apr 162 190 193
RR 22-Apr 163 191 191
CSK 23-Apr 186 214 176
SRH 23-Apr 153 180 175
KXIP 24-Apr 164 192 185
RCB 24-Apr 165 193 202
KKR 25-Apr 177 205 175
RR 25-Apr 159 187 177
CSK 26-Apr 182 210 109
MI 26-Apr 156 183 155
RR 27-Apr 157 185 161
SRH 27-Apr 139 166 160
DC 28-Apr 198 226 187
KKR 28-Apr 172 201 232
MI 28-Apr 158 185 198
RCB 28-Apr 169 196 171
KXIP 29-Apr 151 179 167
SRH 29-Apr 151 179 212
RR 30-Apr 146 174 62
RCB 30-Apr 157 184 41
CSK 01-May 201 229 179
DC 01-May 184 212 99
MI 02-May 175 202 162
SRH 02-May 154 181 162
KXIP 03-May 187 215 183
KKR 03-May 170 197 185
DC 04-May 216 244 121
RR 04-May 190 217 115
RCB 04-May 177 205 178
SRH 04-May 163 189 175
CSK 05-May 194 222 170
KXIP 05-May 202 230 173
KKR 05-May 157 185 133
MI 05-May 169 197 134
CSK 07-May 167 168 131
MI 07-May 182 181 132
DD 08-May 173 174 165
SRH 08-May 157 158 162
CSK 10-May 174 175 151
DD 10-May 160 161 147
CSK 12-May 174 175 148
MI 12-May 186 187 149

© 2019 Rachit Technology Pvt Ltd. All rights reserved.