debruijn / cs2

A project to combine the Counterstrike 2 rankings from ESL, HLTV and Valve.
MIT License
2 stars 1 forks source link

CS2 aggregate ranking

A project to combine the Counterstrike 2 rankings from ESL, HLTV and Valve.

I don't care about explanations, give me the rankings!

Sure! You can find all kinds of combined rankings here and the recommended ranking and points here. If you then have questions, come back here.

Goal of this project

Combine the CS2 rankings from ESL, HLTV and Valve into a single ranking or score. Currently, I do both:

Methodology

This project consists of four phases:

Importing data

To get initial access to the data, I make use of the cs-rankings package. This package can pull data from HLTV, ESL and Valve rankings using either Selenium or directly from the respective git repository. More details can be found in the documentation of cs-rankings. To make sure this project will not pull the data multiple times without reason, the loaded data is cached locally, in the aggregate_cs2_ranking/imported folder. Then, when rerunning the scripts, the local version is used, unless these files are deleted or the import script is run with the force=True flag. Of course, this is occasionally needed to include the newer versions of the base rankings in this project.

Unifying data

The data is merged together to end up with (for each team) their rank and points for each of the three base rankings. To do this, the following steps are taken:

Alternative and combine rankings

For this, there are three type of rankings, all visible in the all_combined_rankings.md:

Rank-based rankings

The rank-based rankings look at the rank for a team in all three rankings, and aggregates them somehow. Then after that, the teams are ranked again based on these aggregations. The ones included are:

Note that some teams have no rank in some of the rankings (especially for HLTV because we only use that up to #30). For that, a virtual rank is included that is the value immediately after the last available rank (so if the HLTV ranking is missing, that team gets rank #31).

Point-based rankings

Next are the rankings making use of the points / scores given by the three ranking providers. Note that we can't just directly take the sum or average of those points, because they work on a different scale. So first, we have to bring them in line with each other. For this, I use two transformations:

The motivation for the first alignment is that it is the transformation that made sense to me beforehand, whereas the motivation for the second alignment is that it is the transformation that turned out to make sense looking at the data: the three rankings all follow the same pattern (roughly) from #1 to #30 using that log_aligned transformation, which is not the case for any linear transformation. In this way, they all have the same weight in the calculations and can be treated equally. A summary of that exploratory process can be seen here:

Summary of the exploraty process of why the log transformation makes the rankings 
comparable.

In this, E, H and V stand for ESL, HLTV and Valve respectively.

Then, for both alignments, I convert them into new scores (and thus rankings) by taking either:

Note again that there are missing points for some of the teams for some of the rankings. As a workaround, a virtual number of points equal to 0 is included.

Combined ranking

Finally, all three types of rankings (the raw rankings from ESL, Valve and HLTV; the rank-based rankings; and the points-based rankings) are averaged to get a mean_combined_rank, which is then converted into a total_rank on which all_combined_rankings.md is sorted.

Creating the Markdown tables

There is little to say on how these tables are created from the results above. In case you are interested in how to convert data into a Markdown file in Python: have a look at the source code.

Future plans

There are several things that I consider adding in the future:

Discussion

No ranking is perfect. This holds for the base rankings from Valve, ESL and HLTV; but it for sure also holds for all my variants. Having various rankings to compare can give additional insight into how dominant a team is; or how clear it is that there is a top 5 separated from the rest; etc. Of course, what happens on the server is more important than what is included here, so use this at your own risk.

Note that the three source rankings (and all my variations thereof as well) are all backwards-looking, not forward-looking. They are in a sense more a ranking of the achievements a team has made, than of the strength of the teams. The only way such a backwards-looking ranking represents the power ranking perfectly as well is if there is long-term stability, which is probably less interesting for the fans. So instead, look at rankings to spot patterns in teams rising and falling; and look at rankings to put those past achievements into context.

Credits and sources

Of course, credit is due to ESL, HLTV and Valve themselves to create these rankings. For all three, a lot of thought and work has gone into these, and it is great that there are three competitive rankings that capture different components of what makes a Counterstrike team good. Thanks!!

Next to that, credit to dchoruzy, the creator of the hltv-data repository, which has acted as inspiration for my own rankings-specific package cs-rankings. Thank you!