• Programming Weekly
  • Posts
  • Uncovering the Secrets of Professional CS:GO Players: A Data Analysis Adventure

Uncovering the Secrets of Professional CS:GO Players: A Data Analysis Adventure

Uncovering the Secrets of Professional CS:GO Players: A Data Analysis Adventure

Introduction

Have you ever wondered what makes a professional CS:GO player stand out from the crowd? Is it raw talent, sharp reflexes, or perhaps a combination of both?

As it turns out, there’s a lot more to it than meets the eye. With the help of data analysis, we can gain valuable insights into what sets the best players apart from the rest.

Note: I would love to continue this analysis. There will be a part 2 if this one gets enough love.

Analysis

Our journey begins with a dataset of professional CS:GO players, including their in-game names, countries, statistics pages, teams, and a wealth of performance metrics such as kill-death ratios, average ratings, total kills, headshot percentages, and much more.

With so much data at our fingertips, we set out to answer some important questions: What factors influence a player’s average rating? Can we predict a player’s rating increase based on their performance metrics? And, most importantly, what does all this mean for the future of professional CS:GO?

First, we got a good feel for the data by checking for missing values and dropping the rows with missing values.

# Load the data into a pandas DataFramedf = pd.read_csv("hltv1.csv")# Get some basic information about the datasetprint(df.info())# Check for missing valuesprint(df.isnull().sum())# Drop the rows with missing valuesdf.dropna(inplace=True)

We then plotted to scatter plots of various columns against average ratings to see if any patterns emerged. The properties revealed some interesting trends, such as a strong correlation between total kills and average rating, as well as headshot percentage and average rating.

For reference, the average professional player has a rating of 1.

Predicting Rating From Total Kills

Predicting Rating From Headshot %

AWP players tend to have a higher rating than average. The AWP is a sniper rifle, considered by most the best gun in the game. The AWP does not require headshots to get a one-hit kill.

Predicting Rating From Rounds Played

Regression

But the real magic happened when we fit a linear regression model to predict average ratings based on impact.

Impact, as calculated by HLTV, is a comprehensive metric that takes into account a player’s multi-kills, clutch wins, damage done, and many other factors. An average impact rating is 1.

By using impact as the predictor and average rating as the response, we were able to train a model that could make reasonably accurate predictions. The mean squared error of the model was quite low, indicating a good fit.

# Fit a linear regression model to predict average rating based on impactreg = LinearRegression()X = df['impact'].values.reshape(-1, 1)y = df['rating'].values.reshape(-1, 1)reg.fit(X, y)# Make predictions on the impact valuesy_pred = reg.predict(X)print(y_pred)# Calculate the mean squared errormse = mean_squared_error(y, y_pred)print("Mean Squared Error:", mse)# Get the coefficients from the regressionbeta_0, beta_1 = reg.intercept_, reg.coef_[0]# Define a function that takes in the number of rounds played and returns the expected increase in ratingdef marginal_effect(impact): return beta_1 * impact# Calculate the expected increase in rating for average impactexpected_increase = marginal_effect(.01)print("Expected increase in rating for increase in impact:", expected_increase)

Results:

Expected increase in rating for every .01 increase in impact: 0.00536073

Interpretation:

An increase in impact is hard to measure in real terms since HLTV hides the computation of the metric, we only know for certain a handful of variables that make up impact. A .01 increase in impact could be a singular multi-kill round or a singular clutch, or it could be 20 clutches.

Either way, it is safe to assume that impact has a significant effect on rating due to our low MSE:

Mean Squared Error: 0.0015457354809645092

But wait, there’s more!

In addition to using impact as a predictor, we also created a regression model to predict average ratings from rounds played. This gave us an even broader perspective on the factors that influence a player’s performance.

# Fit a linear regression model to predict average rating based on rounds playedreg = LinearRegression()X = df['rounds_played'].values.reshape(-1, 1)y = df['rating'].values.reshape(-1, 1)reg.fit(X, y)# Make predictions on the impact valuesy_pred = reg.predict(X)# Calculate the mean squared errormse = mean_squared_error(y, y_pred)print("Mean Squared Error:", mse)# Get the coefficients from the regressionbeta_0, beta_1 = reg.intercept_, reg.coef_[0]# Define a function that takes in the number of rounds played and returns the expected increase in ratingdef marginal_effect(rounds_played): return beta_1 * rounds_played# Calculate the expected increase in rating for every round playedexpected_increase = marginal_effect(1)print("Expected increase in rating for every round played:", expected_increase)

Results:

Expected increase in rating for every round played: 1.03238796e-06

Interpretation:

That number comes out to be: 0.00000103238796.

This means that for every round a CS:GO professional plays (in a tournament), on average, they can expect a rating increase of 0.00000103238796.

That means it would take, on average, 50,000 rounds of professional counter-strike to increase your rating by 0.05.

Each round of counter-strike is about 2 minutes. That means it would take 100,000 minutes of professional play, or 1666 hours to increase your rating by 0.05. This does not include practice, watching demos, aim training, etc.

That’s a lot of counter-strike.

MSE:

Mean Squared Error: 0.004304950960976675

What does this mean?

The impact appears to be the better variable to predict rating. Thus we can confidently say that skill & strategy > hours played.

By comparing the results of these two models, we could get a more nuanced understanding of the complex interplay between various performance metrics and average ratings.

So, what does all this mean for the future of professional CS:GO? Well, for one, it suggests that there’s much more to a player’s success than simply their kill-death ratios or headshot percentages. Factors such as impact and rounds played are just as important, if not more so.

This could have important implications for teams as they scout and sign new players, as well as for players themselves as they strive to improve their performance.

And remember: Round-to-round impact has stronger statistical implications than experience.

Conclusion

In conclusion, our data analysis adventure has shed new light on the secrets of professional CS:GO players. With the help of Python, we were able to uncover some of the critical factors that influence a player’s success, and offer some valuable insights into what the future of the competitive scene might look like.

So, the next time you’re watching a pro match, remember that there’s a whole lot more going on beneath the surface!

Remarks

If you want to support me, please consider following on Medium and LinkedIn.

Not financial advice. You should seek a professional before making any financial decisions.

Reply

or to participate.