An interesting tale about Chess
By: Nick Major
Tags: Chess, Data Science, Regression

Lichess.org is a popular chess website where more than 14,688,000 moves are play every day! As one of the premier websites to find a game or a tournament, Lichess has a bevy of information that it willingly gives to help the community. Using data gathered from Lichess, I delved into the statistics of this wonderful game to glean some information.

Let’s start of with some basics:

1. White has an advantage going first.

Intuitively this is obvious, but the win rate of each color doesn’t depict the full story. The Win rate for white in this data set is 49.86%, Blacks win rate is 45.40%, and the draw rate is 4.74%. We understand that going first is an advantage due to the chess fundamentals we develop over time, but that’s noe the whole story.

According to the data, White’s Win Rate Variance is 51.39% compared to Blacks 48.2%! This means that taking expected variation of games into account, as well as the Draw rate (0.4 %), White has a hidden advantage. The onus is on white to prove that they deserve to win, whereas the draw disproportionately affects black and the onus is on black to draw. This is classically true in high level chess, where the draw rates can exceed 40% in standard lines. In online time formats most games end in a forfeit due to the clock. Speaking of the clock

2. White’s advantage hinges greatly on the time format.

The left number is minutes, while the right number is seconds per move.

With a quick observation we can see that the 10 min games are the most popular, in fact, they comprise of 38.49% of all games in this database. While there is some variation we can delve into, it seems that the lowest time increment (5+5) has the highest win rate for white, while 30 minutes, has the lowest win rate for white. The time format with the highest draw rate is surprisingly the 15+10 rating, instead of 15+15. This, in combination of the nearly 51% win rate may indicate that 15+10 has a disproportionate amount of computer assistance compared to other formats.

3. The Queens pawn openings actually favor Black!

A00 is the code for all of the odd openings

While the French defense (C00) is the most common in this dataset, the Queens pawn opening (D00) scores favorably for black. In your chess career, you may pick up this idea that moving the King’s pawn on move 1 leads to more attacking chess, and moving the Queen’s pawn on move 1 leads to more positional chess. This stigma seems to bear out in the data for win results as well. Versus most 1. d4 lines, Black has some consistent options and viable gameplans that are hard for white to push against. Whereas with 1. E4, there are a plethora of different aggressive styles that White has to choose from, and Black is stuck playing in a few established lanes.

4. The ratings on Lichess are inflated!

Gaussian curve.

An ELO system is a rating algorithm that tries to evaluate the individual player versus their competition. These rating systems follow the standard Gaussian curve of distribution, with the majority of people settling in the center at an ELO of approximately 1250, plus or minus one standard deviation. Lichess’s ELO system is inflated.

The average rating of a player on Lichess is 1596. The average USCF rating of a “strong” beginner is 1000, the average rating of a tournament players is about 1400. When starting out on sites such as Lichess.org and Chess.com, be aware of the differences between your online rating, and what’s called the “Over the Board” rating.

5. The Length of a game is surprisingly long

In high level chess a miniature is any game that is less than 25 moves. This is because every opening has been analyzed for at least 25 moves, and even before computers were used, Grandmasters were expected to now 15+ moves of theory on any opening they played. In the event you have a game end in 25 or less moves, that means that in approximately 10 moves, that player went from even to resigning. In online play, where the relative knowledge of each player is going to be significantly less, you would expect to see shorter games, but from the data, it seems even over short time formats the average length of game is 60! The takeaway? Don’t give up! Your opponents won’t.

This scatter chart assesses the disparity in rating, and it’s affect on the length of games. As you would assume, the greater the difference in player skill, the shorter the games were; however, the estimated length of games still stays relatively high.

Even if the difference between players reaches it’s maximum (1900~), the estimated length of game stays above 25 moves until a whopping 1669 rating disparity. While it’s reasonable to assume these games don’t happen very often, the math proffers a simple piece of advice: Don’t give up!

Let’s leave the basics for some more complicated analysis.

Using some feature engineering, I turned the Lichess dataset into an analysis on the win/loss/draw rate, Disparity between rating, a transformation from chess ELO to groupings such as Gold, Diamond, Wood 5, etcetera. With my feature engineering I wanted to see if any combination of this data would be useful in determining the ranking of the players.

I built two models, one using a bagging method called Random Forest Classifier; and the other a boosting method called XGCBoost, I was able to get a 72% and 73% accuracy score respectively. With further analysis, it should be possible to analyze which openings are truly best for a beginner player using regression models.

In conclusion

In 2016 I picked up Chess with a friend that I met in college, we delved in the game with a hunger, and quickly realized the sheer volume of information involved with the game. Later that year I placed 2nd in my bracket (>1250) in my first national tournament. In the past few years I have improved my playing ability significantly and started coaching new players. The process of intuiting a game that is based on logic can be rough at first, but with some analysis, and help from others it’s possible to forge a path ahead.