World of Cricket: Are The Players Really Worth All Those Crores?
By: Muneef Rizvi
Tags: Cricket, Ipl, Pricing Strategy, Regression, Data Science

Ever since the Indian Premier League debut in 2008, the tournament has seen many great legends play on famous and legendary grounds. Over the years, players have gotten auctioned off for prices as high as ₹16 crores. But what makes these players worth so much money? Is it their high batting average? Or perhaps just the mere fact that they’re allrounders? And are they really even worth all that money?

Throughout the years, inconsistencies has been observed in the pricing of players and their performance in the tournament. Franchise owners sometimes end up paying way too much for a certain player who ends up not contributing as much to the progress of the team. Similarly, there are players who cost less but outperform some of the more expensive players. Therefore, it seems rather imperative for there to exist an auction system that evaluates a fair price of a player based on their recent performances.

This article will inspect and dissect IPL data from 2016, 2017, 2018, and 2019 in order to gauge the attributes that contribute towards the price of a player and come up with a metric to judge how much a player should be auctioned for.

Our Dataset

We used Kaggle to collect datasets of IPL from 2016 to 2020. For a better idea of the data frame that we have, here is an extract of our dataframe:

The data contains a total of 631 entries and 24 unique attributes. Every row consists of a unique player and the columns indicate the factors that affect their auction price. To understand this data, here is the description of each column:

Columns:

1.Team: The team the player was a part of in that season

2. Player: Player name

3. Tournament: The year the tournament was held in

4. Runs Scores: Number of runs scored in the season by the player

5. Batting Average: Average number of runs scored by the player in that season

5. Balls Faced: Number of balls faced by the player in that season

6. Batting Strike Rate: Batting strike rate of the player in that season

7. 100s: Number of centuries scores by the player in that season

8. 50s: Number of half-centuries scores by the player in that season

9. 4s: Number of fours scores by the player in that season

10. 6s: Number of sixes hit by the player in that season

11. Overs Bowled: Number of overs bowled by the player in that season

12. Wickets Taken: Number of wickets taken by the player in that season

13. Bowling Average: Bowling average of the player in that season

14. Bowling Economy Rate: Bowling economy rate of the player in that season

15. Bowling Strike Rate: Bowling strike rate of the player in that season

16. 4+ Innings Wickets: Number of innings the player took more than 4 wickets in that season

17. 5+ Innings Wickets: Number of innings the player took more than 5 wickets in that season

18. Catches Taken: Number of catches taken by the player in that season

19. Stumpings Made: Stumps made by the player in that season

We combined this data with 4 other attributes that were manually added:

Age: Age of the player

2. Country: Country the player is from

3. Wicketkeeper: Binary variable indicating whether the player is a wicketkeeper or not

4. AllRounder: Indicates whether the player is a Batsman, Bowler or All-Rounder

In addition to the aforementioned information, we will be later gauging the possibility of incorporating a popularity index that will assess the popularity of each player based on results obtained from using web keyword search tools.

Preliminary Operations on the Dataset

Naming Scheme for Players

Firstly, we had noticed that the names on the Dataset for Prices were different than that of the IPL Dataset that we had. For that case, we had to define a naming scheme which would have required a lot of cleaning. We used the name column and for each player, searched the player on google and got the unique identfier in the http address of espn cricinfo of that player

2. Assigning DataFrames to Yearly Data

This is how our data is going to be structured:

For IPL 2020 Auction, we input statistics from 2019 and 2018 (only the relevant columns) We merge that with the prices of 2020, ensuring that the players are consistent in all three years. Each year will be given a different weightage to account for the most recent performances being analyzed. In total, we will have 4 data frames:

a) IPL 2019

b) IPL 2018

c) IPL 2017

d) IPL 2016

In order to adjust the age of each player in our dataframes, we used the following code:

#Fixing Age for years

df_2019[‘Age’] = df_2019[“Age”]-1

df_2018[‘Age’] = df_2018[‘Age’]-2

df_2017[‘Age’] = df_2017[‘Age’]-3

df_2016[‘Age’] = df_2016[‘Age’]-4

Exploratory Data Analysis

Although the scope of the project seems pretty straightforward, there were a lot of caveats that we had to take care of even before visualizing any data. Firstly, we had to keep a note of the variable types in each column; had a column not been an integer or float, we could not manipulate the data in the way we had wanted.

Step 1: Once all the data was collected, we checked for the prices and age of each player.

Step 2: Since there was an inconsistency in the pricing of players (both Lacs and Crores were mentioned), we had to standardize it and change it to the units of Lacs to allow for fair comparisons.

Step 3: We merged Price and Age into our main dataframe (Price was merged into our yearly dataframes)

Note: We have already assigned unique reference numbers for names and associated prices.

Step 5: Cleaned the data of any NaN and “-” values.

Step 6: Checked the datatype of each column

Data Visualization

To better understand the type of data we are dealing it, following are the results of some of the plots we made to better picturize the magnitude of data at our disposal:

Age Breakdown of Players in a Particular Season Most and Least Expensive Players in a Season

Observation: Most players in 2019 were aged between 25 and 31

To sort Most Expensive and Least Expensive Players, the following code was used:

Comment: We can see that there is a preference for Batsman, and for the more informed cricket fan, an Indian Batsman who can captain their side are worth the most, followed by an international player who can also captain the team.

Observation: Virat Kohli ,MS Dhoni, Rohit Sharma seem to remain in the top 5 throughout.

Note: One important thing to note is that we have excluded players that were in the top 5 most expensive, but did not play in either of the last 2 seasons. This could ultimately have skewed the model that we have wanted to make eg: Pat Cummins

Operations on the Dataset

As our end goal aims to pinpoint the qualities that contribute towards the high value of a player, we need to closely evaluate the statistics and features of these very players. The following plots help visualize some of these aspects:

Note: The general code used to make these graphs can be seen below:

Note: To iterate over a different statistic, replace the column name with the other column

A general trend can be seen from observing the above graphs: these players have been above average in all major metrics to gauge batting performance. However, to further determine the importance of a high batting metric to the price of the player, we need to look at the overall stats of Batsman within this season:

The distribution of the batting strike rates from IPL 2018 shows that the most frequent strike rates were between 100 and 150. This implies that the top Batsman were not players with the highest Strike Rates

On the other hand, the scatter plot of Batting strike rate vs Price of a player shows that the higher the batting strike rate is for a player, the more they’re worth to franchise owners. Hence, a relationship is observed if we take a bigger sample of Batsman.

This right-skewed distribution of the batting average from IPL 2018 indicates that batting average of less than 20 was dominant in that tournament.

However, a general upward a trend is shown in this scatter plot of batting averages vs price of a player, the higher one’s average is, the more they’re worth; especially if there average is above 30. This shows to us that these Batting Statistics are good enough indicators to evaluate the fair price of a player.

What about the Bowlers

We just simply can’t ignore how important a good bowling attack is for any team, especially in a competition like the IPL. Now, although we can see Batsman are monetarily valued more than a Bowler, let’s see how the Bowlers fare.

We first found out at what prices are the most expensive and least expensive bowlers are valued at. This was down by first making a data frame of just bowlers and then the same operation was performed as above:

As we need to see how price can possibly fluctuate based on the qualities of a bowler, we see the following plots:

Based on these results, we can note two important features:

How a low Bowling Average, Economy Rate and Strike Rate is common in most of the top bowlers in this league. This could potentially indicate a Negative correlation between the Prices and these rates All of the top 10 bowlers have taken over 10 wickets minimum in their preceding seasons so it could be of note to divide wickets into intervals and see how each interval is affected by price Like what we observed from the Batsman graphs, a trend can be seen from observing these graphs; all of these players have been consistently above all aforementioned metrics. We now need to see whether the bowling statistics follow a particular distribution or trend.

Based on these 2 tables, we can make 2 key observations:

There seems to be no clear pattern in terms of how the Strike Rate affects price, this might lead to a low correlation with the Price of a player It is rare to find bowlers who have a Strike Rate of less than 15 and likewise, it is very likely for a bowler to be overpriced in comparison to other bowlers

Possibility of a Correlation

All we have done so far was to investigate whether the prices of a cricketer can be adequately associated with their Batting and Bowling metrics alone. We had come to a decision that Batting metrics have a more predominant effect on the prices in comparison to the Bowling metrics. Now, to further validate this assumption, we can run a correlation matrix to see how each variable affects each other and more importantly how that variable affects the price.

This correlation matrix of attributes with relation to prices shows that there’s a high positive correlation between attributes of a particular type of player. For example, for a batsman, there’s a high positive correlation between runs scored and the number of balls faced, number of fours and sixes hit, the batting strike rate etc which essentially means that by increasing one attribute of a player, the other is also increased. Similarly, for a bowler, there’s a positive correlation between one’s bowling average and bowling strike rate.

What is more interesting is that if we see the last row, i.e the price row, we can see that batting attributes have a higher correlation value in magnitude when compared to Bowling Statistics, thus proving our hypothesis. But at the same time, it also tells us that each factor can separately contribute to the price of a player- be it a Batsman, bowler or an All-Rounder.

Machine Learning Model- Multiple Linear Regression

In an effort to build our Machine Learning Model, we need to amalgamate all 3 dataframes into one such that name of the players don't matter, but rather the statistics for a said player/row in a 2 year window. To incorporate these 3 dataframes, we used the Regex library to rename each column to test the possibility of whether the statistics of the most recent year have more weightage than the previous year. Moreover, the data is modelled such that if a player has played all 4 seasons from 2016–19, he will have 3 separate entries; for example, Virat Kohli.

We then proceed to divide our into the trained and test datasets on which we implemented Linear Regression using sklearn. In our test run, we realized the accuracy scores were not showing as much promise as we had hoped so we went back to our dataset. We realized that if we standardize each column or tune the dataset based on the values of the data in that particular column, it could offer better results. So we standardized each metric with each other and converted the popularity index into a logarithmic form so that its similar to the values of the other columns. This proved to benefit our result greatly as we initially had an accuracy score of above 20%. We still knew we had a lot to still check!

We calculated the R² value first by checking how the accuracy score is affected by 1 year of data with incorporating popularity index and then compared it to the accuracy score of 2 years of data with and without population index taking into account. We observed that the 2 year data with the incorporation of the index showcased the best result. Thus validating our claim, that fine-tuning parameters does increase the accuracy of our model.

Conclusion and Learning Outcomes

It is important to not the let the lack of correlation or accuracy score discourage the possibility that pricing is possible. Although the accuracy scores are not as high as one would come to expect, we can see a gradual trend in observing how particular performance metrics have much more significance and relation with the prices of said player. Hence, a more polished dataset of performance metrics, in a different sport, can indeed be used to gauge the Fair price of a player. In particular, by changing the parameter of a certain beta coefficient of a performance metric by a said unit, we can see how that SHOULD change the price of the player.