Connect with us


Finding a replacement for Gerard Pique using Machine Learning




Photo by Eric Alonso/Getty Images

Barça Universal uses a machine-learning algorithm to find five players from within the La Liga who can act as the replacement to Gerard Pique, taking over the centre-back berth for Barcelona.

Club legend, Gerard Pique joined FC Barcelona in 2008 and has been a starter for nearly 12 years. While the Spaniard’s defensive ability and intelligence has not faltered, age, being the cruel mistress it is, is catching up with him. Now 33, Pique is not the physical demon he used to be, and so his exit from Catalonia shortly seems inevitable, and the burden to find a replacement falls on Barcelona.

Players come, and players go. Having won everything in a Blaugrana shirt, Pique will leave with his head held high. His exit won’t be a tragedy, however, failing to find a suitable replacement, will. Matthijs de Ligt and/or Eric Garcia seem like the two options destined to be Pique’s successors.

However, recent years have shown that the transfer market is extremely unpredictable, and it would be imprudent not to consider more players who can act as a replacement to Pique. These are players Barcelona can target in the net three transfer windows, and secure their transfer before someone else comes calling.

K Means Clustering

K Means Clustering is an unsupervised machine learning algorithm. As the name suggests, it creates ‘clusters’ of data points that share similar characteristics. The algorithm splits a data set into K number of clusters.

Initially, K number of centroids (a centroid is a data point at the centre of a cluster) are chosen. These centroids are data points in the data set and are picked at random. The centroids are used to train a ‘classifier’ that classifies data sets, which produces a randomized set of clusters. Following that, each centroid is set to the arithmetic mean of the data points in its cluster. This process keeps on repeating till the values of the centroids stabilize.

The final centroids then classify data points from the data set into clusters. In this case, the data points refer to the defenders in La Liga.

K means Clustering Pique replacement

The Data

The data that will be used in this article will be Per 90 statistics for defenders in the 2020/21 La Liga season (so far). The defence, along with Pique have not been in top form this season, and so we will be using Pique’s 2018/19 league season as the standard to find a replacement. All of the data is from

Here is a list of the metrics that will be used:

  1. Tkl: Number of players tackled
  2. TklW: Number of tackles won
  3. Def 3rd: Tackles in the defensive third
  4. Mid 3rd: Tackles in the middle third
  5. Att 3rd: Tackles in the attacking third
  6. Tkl (D): Number of dribblers tackled
  7. Att (D): Number of dribbles contested
  8. Tkl% (D): Percentage of dribblers tackled
  9. Past (D): Number of times dribbled past
  10. Press: Pressures
  11. Succ (Press): Successful pressures
  12. % (Press): Successful pressures percentage
  13. Def 3rd (Press): Pressures in the defensive third
  14. Mid 3rd (Press): Pressures in the middle third
  15. Att 3rd (Press): Pressures in the attacking third
  16. Blocks: Number of blocks
  17. Sh: Number of times blocking a shot
  18. ShSv: Number of times blocking a shot that was on target
  19. Pass (B): Number of times blocking a pass
  20. Int: Interceptions
  21. Tkl + Int: Number of players tackled plus interceptions
  22. Clr: Clearances
  23. Err: Errors (mistakes leading to an opponent’s shot)


After developing and applying the K means Clustering algorithm, there were five players closest to Pique according to the cluster, and can be his replacement. These are the five players who are most similar to Gerard Pique:

  • Mouctar Diakhaby
  • Unai Núñez
  • Joaquín Fernández
  • Joseph Aidoo
  • Jules Koundé

A broad analysis

Mouctar Diakhaby

Age: 23
Nationality: French
Current Team: Valencia

Mouctar Diakhaby pique replacement

If not anything else, Barcelona fans can be assured that Diakhaby will give his 100% every game. (Photo by Manuel Queimadelos Alonso/Getty Images)

Mouctar Diakhaby is a French professional who plays for Valencia CF in La Liga. In September 2016, Diakhaby made his professional debut for Olympique Lyonnais against Bordeaux, as a 19-year-old. Two years later, in the summer of 2018, Diakhaby sealed a move to Valencia.

The Frenchman mirrors Pique’s playstyle. He likes to play short passes, which falls in line with Barcelona’s philosophy of building from the back. Additionally, he does not dive into tackles but rather prioritizes getting his positioning right.

Today’s game is more physical than ever. Diakhaby stands tall at 6’4 as a result of which he can win headers easily. His height and physique also make him a danger in the opposition’s box. In fact, The Frenchman scored 3 goals in the Europa League in the 2016/17 season.

With Valencia’s current financial state, Barcelona can snatch Diakhaby for quite a modest fee, making him a low-risk, high-reward prospect.

Unai Núñez

Age: 23
Nationality: Spanish
Current Team: Athletic Bilbao

Unai Nunez Real Madrid

There is little doubt over Nuñez’s abilities, but he needs to find more consistent footing. (Photo by Juan Manuel Serrano Arce/Getty Images)

Unai Núñez has been touted to become Spain’s next great centre-back, succeeding the likes of Gerard Pique and Sergio Ramos. In August 2017, Núñez made his debut for Bilbao against Getafe CF in a 0-0 draw, becoming a regular starter in his debut season (reminiscent of Pique in the 2008/09 season).

Núñez stands tall at 6’2, however, his technical abilities are his greatest strength. The Spaniard has all the makings of a great ball-playing centre-back. He likes to dribble, carrying the ball out of the defensive third himself.

Núñez can also make great line-breaking, long passes that can directly contribute to goals; a quality possessed by his predecessors Gerard Pique and Rafael Marquez. Additionally, Núñez can be a candidate for the future captain of the club, due to his composure and concentration. The lack of focus in the defence in recent years has led to results such as 0-4 at Anfield and 2-8 in Lisbon.

In recent weeks, Nuñez has been forced to the bench by Yeray Alvarez, but that does not remotely echo of the potential he possesses, and his importance with Athletic Bilbao.

The young Spaniard has been scouted by many European giants such as Manchester City and Bayern Munich. Núñez’s €30 million release clause makes him both a bargain in today’s market and yet another situation where the pros are expected to outweigh the cons heavily.

Joaquín Fernández

Age: 24
Nationality: Spanish
Current Team: Real Vallodolid

Joaquin Fernandez pique replacement

Fernandez (#24) celebrates his goal against Deportivo Alaves. (Photo by Gonzalo Arroyo Moreno/Getty Images)

Joaquín Fernández, is a Spanish footballer who plays for Real Vallodolid. The youngster is a versatile player who can be deployed as either a centre-back or as a defensive midfielder.

Fernández is the current captain of Vallodolid, which, at 24, is a testament to his brilliant leadership skills. At 6’3, he is an imposing figure in and near either penalty area, and often aerial duels against him go uncontested. Additionally, Fernández is capable of making long passes into the attacking third.

While the Spaniard is not as rated as Núñez or Diakhaby, he is still a player who can contribute to the team, and due to his low market price, he is an excellent value for money.

Joseph Aidoo

Age: 25
Current Team: Celta Vigo

Joseph Aidoo pique replacement

Aidoo is the glue holding the otherwise frail Vigo defence. (Photo by Octavio Passos/Getty Images)

Joseph Aidoo is a Ghanian professional football player who plays as centre-back for Spanish side Celta Vigo. In the summer of 2019, Aidoo sealed a move to Celta from KRC Genk for a reported €8 million. He made his debut in a 1-0 home win against Valencia.

Aidoo, being only 6 feet, is not great at eliminating aerial threats. However, he is an excellent tackler of the ball and is great at intercepting passes on the ground. Additionally, the Ghanian has the potential to become the perfect ball-playing centre-back. He likes to play short passes, which helps build from the back and boasts of excellent close control and technical finesse. To top it off, he is visibly faster than Pique ever was.

Aidoo’s defensive abilities make him an option worth exploring, especially if Barcelona want to contain the plethora of counter attacks they face game after game when the opposition cuts past their midfield.

Jules Koundé

Age: 21
Nationality: French
Current Team: Sevilla FC

French centre-back Jules Koundé has a great claim for being the best young centre-back in the world. In the summer of 2019, Koundé moved to Sevilla for a reported 25 million euro transfer fee. The youngster has done nothing but impress since his transfer. Koundé ended his debut season as a European champion after winning the UEFA Europa Cup with Sevilla and was named in the Squad of the Season for the competition.

As a regular starter in the 20/21 season, Koundé has been dominant. He was flawless at the Camp Nou against Barcelona and was also great against Bayern Munich in the UEFA Super Cup where he ensured that Robert Lewandowski had a quiet game; for the most part anyway.

Jules kounde Barcelona

Kounde was inarguably the best player on the pitch in the Sevilla-Barcelona tussle. (Photo by LLUIS GENE / AFP)

The Frenchman possesses excellent defensive and technical prowess. He is a superb passer of the ball, making him an ideal ball-playing centre-back. He likes to make short passes which helps the team build from the back and maintain possession.

Moreover, Koundé does not dive into tackles, rather, he prefers to stay on his feet and ensure that his positioning is perfect. In spite of being just 6 feet, the youngster is commanding in the air, courtesy of his dominating leap. Additionally, Koundé is quick and sharp, he can recover the ball when the opposing team is counter-attacking.

The Frenchman could quite possibly become the best centre-back in the world in a few years and quality like that comes with a price. Sevilla would take their time, and can easily fethc upwards of €65 million for the 21-year-old.

Sevilla reportedly rejected Manchester City’s offer of €55 million + Nicolas Otamendi in the summer transfer window. It is no news that Zinedine Zidane is quite fond of the youngster, and was interested in signing him last season. A move to arch-rivals would be a huge blow for Barcelona, who, as reported by Mundo Deportivo are keeping tabs on Koundé and could make a move for him in the future.


All 5 potential replacements have their strengths and weaknesses. Statistics do not always portray the full picture, and finding a replacement for a player with the calibre of Pique will require extensive research and scouting.

Moreover, there are great options outside of Spain such as Matthijs de Ligt, who has the potential to lead Barcelona’s backline. However, everything considered, as it stands, due to his talent, it would appear that Jules Koundé is the best possible replacement for Gerard Pique.

My name is Malhar. I've been watching Barcelona ever since I saw Barca's Spanish players dismantle opponents for fun in the 2010 World Cup. Over the years, my love for Barcelona has evolved into a passion to write about Barcelona. I love writing about the club. I usually have very unpopular opinions, but I'm proud of them and I stand by them. Feel free to discuss about anything related to football, with me!



Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Avatar


    15/11/2020 at 19:43

    A very good article, I always enjoy articles bases on data as opposed to subjective opinions. It would be interesting to do the same analysis on De Ligt and Garcia to gauge how they compare with Pique.

    • Malhar


      16/11/2020 at 09:23

      Definitely will look into doing a statistical comparison between de Ligt/Garcia and Pique. Thank you for the response!

  2. Avatar


    16/11/2020 at 12:42

    Amazing article! I agree with Greg, statistics based articles are more enjoyable.

    I was wondering if you don’t limit the results to current La Liga players. If you compare center-backs across the top 5 leagues, see how they match up to Pique.

    • Malhar


      27/11/2020 at 15:37

      Thank you for the suggestion. Will work on that!

  3. Avatar

    Abhijeet Gupta

    27/11/2020 at 14:31

    I am a Machine Learning enthusiast myself and I really love your approach. Detailed, descriptive approach.

    I had a question though. In the K-Means Analysis that you performed, I see that your have taken number of clusters (k) as 3. Why is that? And which of those clusters would represent Pique?

    • Malhar


      27/11/2020 at 15:40

      Appreciate the compliments! I chose the number of clusters to get roughly 4-6 players in each cluster, since I was aiming for 5 potential replacements for Pique in this article. Pique was also a part of the cluster that the 5 players in the article belonged to. Since they belonged to the same cluster, they were qualified to be his potential replacements as they were similar players!


Erling Haaland — One for Barcelona to chase

Jan-Michael Marshall



Photo via Getty Images

Erling Haaland is set to dominate the world of football for the next decade, and Barcelona will regret if they do not sign him in the next summer window.

Whenever Barcelona are linked with new players, one question always emerges: “Does he have the Barça DNA?” Although a vague term, Barça DNA has come to mean the traits that a Barça player should have, whether already at the club or a prospective transfer. These traits include everything from being technically sound to fitting a possession-oriented style — think of Xavi Hernández, Andrés Iniesta, and Lionel Messi.

It’s natural for a club to want players that fit their ethos, especially Barcelona who have such a well-established identity, but where should the line be drawn? Should the Blaugrana miss out on top players because of an inhibition to change tactics, or should the team mould itself around them?

This is where Erling Haaland comes into play. At only 20-years old, Haaland has already solidified himself as one of the best young players in the world, and his position at centre-forward fills a dire need for the Catalans. And to the joy of Culés, the links to him have already begun, with Joan Laporta particularly interested in signing him for the club when and if he becomes President.

Rumours around his signing prop up two eternal arguments: He’s a world-class player that we need versus, he doesn’t fit our player profile.

How do Barcelona navigate this tricky situation?

Who is “The Terminator”?

Dubbed ‘the Terminator’, Haaland burst onto the world stage in the 2019-20 season with Austrian club Red Bull Salzburg, tallying 24 goals in 20 appearances. He also made headlines with the Norwegian international team in the under-20 World Cup, where he scored nine goals in one match.

Haaland meditation PSG

His ‘meditation’ celebrations are among things Haaland has caught attention for. (Photo via Imago)

In January 2020, he made a mid-season switch to Borussia Dortmund and has been wreaking havoc ever since. Now in the midst of his first full season with the German club, Haaland has scored 33 goals in 31 appearances, winning the Golden Boy Award as well, looking set to dominate world football for the next decade.

Player Profile

Haaland is notorious for his finishing, goal-scoring instincts, and intelligent off-the-ball movement. He scores in a variety of manners, whether with powerful long-range shots or well-placed finishes. As aforementioned, his goalscoring record speaks for itself, having already scored 17 goals in 13 appearances this season.

At 6’4″, he is a menace for opposing defenders, boasting a natural ability in the air as well as blistering pace, a combination unheard of, and feared. Earlier this year in a match against Paris Saint-Germain, the Norwegian reached a top speed of 36 kilometers per hour.

The 20-year old tends to play off the shoulder of the defence, menacingly waiting for a through-ball or long ball from his creative teammates.

Below is Haaland’s heat-map from this season, representing his average positions on the pitch. Evidently, he lurks in and around the box, waiting for the right moment to pounce.

Haaland’s heat-map from for the 2020/21 BuLi season. (Courtesy Sofascore)

With the ball at his feet, his pace and physicality allow him to out-run his defender, and without it, his world-class positioning always results in him being in the best spot to score a goal. His movement also drags opposing defenders, putting his teammates in prime goalscoring opportunities. Haaland is a nightmare to defend and must be closely marked because all he needs is a sliver of space to score.

Though not his best attribute, he can link up well with his midfielders, playing small one-twos, then receiving the ball in the penalty box.

Haaland header

Haaland is a versatile scorer, who can do a lot with creators like the ones Barcelona has behind him. (Photo via Imago)

Haaland is a counter-attacking threat as he can use his pace to capitalize on regrouping defenders. He’s also adept at holding up the ball, fending off defenders with his physicality and laying the ball off to his teammates. He’s an old-school number nine, with drops of a brilliant, adaptable player who can score goals out of thin air.

With at least a decade in front of him, Haaland can still improve, and one can only wonder what his ceiling is.

“I’ve maybe been around too long but I have never seen a guy since maybe Messi or Ronaldo that developed at such a young age. That’s very unique and he has all the possibilities to become a really world class player.”

 Norway coach Lars Lagerback 

The Numbers Behind the Player

In his young career, Haaland has already established himself as one of the most lethal finishers in the world. He recently became the youngest and fastest player ever to reach 15 Champions League goals, as well as the youngest to score four goals in a single Bundesliga match.

The Norwegian-international has taken 91 shots on target in his professional career, and scored 72 goals, giving him an astonishing shots on target to goals ratio of 79%. He’s averaging 4.21 shots per 90 minutes this season and 2.59 shot-creating actions. Additionally, he comes up with 0.53 goal creating actions a game, showcasing how much of an all-around threat he is.

The following graphic compares Haaland’s statistics in the last two seasons with top-five league forwards.

Haaland barcelona


His goalscoring attributes (red) clearly stand out and his creative stats (yellow) are promising too.

The graphic below compares Haaland’s stats in the Bundesliga over the last two seasons with Bayern Munich’s talisman Robert Lewandowski.

(Graphic from Understat)

The stats are eerily similar, albeit Haaland has played almost half as many minutes as Lewandowski, arriving not before January. The most noteworthy one being the G90 (goals per 90) and A90 stats (assists per 90), where he eclipses the Pole. A goalless outing today barely provides a dent to what has been a fantastic start to life in the 2020/21 Bundesliga season.

Should Barça sign him?

Haaland is evidently a world-class forward, yet questions about his fit persist. Some fans question whether his player profile suits the Catalans, and many are wary of his lack of “Barça DNA”.

While he’s not as much of a creator as Barça might want in the striker position, he’s by no means inept and still has so much time to improve. Furthermore, Barça’s front line is filled with creative players like Lionel Messi and Antoine Griezmann, and they desperately need someone who is lethal in front of goal. He may not be renowned for his passing or creating in tight spaces, but he excels in the most important duty of a goalscorer: scoring goals.

Erling Haaland PSG

The goal against PSG is testament of the plethora of goals Haaland is capable of scoring, something Barcelona crave for. (Photo by Lars Baron/Bongarts)

On the other hand, Barça typically face teams that like to sit-deep and form a low block. How would Haaland fare against opposition that won’t allow him to maximize his pace and darting runs? Given his ability and instincts, it’s safe to assume that with the right creative pieces behind him, there’s no doubt Haaland could thrive in any setup, especially given his height and built, which can help him bully the strongest defenders in the box.

Above all else, it’s necessary to consider whether Haaland would even want to go to Barcelona, let alone whether the Catalans should pursue him.

The club is an institutional mess, and the squad is performing poorly. It’s not exactly an ideal spot for any player. Barcelona are also struggling financially, and can not realistically pursue Haaland without offloading a lot of other players. Haaland does have a fixed release clause of €75 million, though, and certainly, that plays into Barcelona’s lap. The centre forward would definitely need assurances of being an undisputed starter, as his ability certainly warrants that.

Another reason Barcelona should definitely get into the action to bring him to Spain is because rivals Real Madrid are the clear favourites to sign Kylian Mbappe from Paris Saint-Germain. Ansu Fati, for all his brilliance, is too young to draw comparisons with the Frenchman, but Erling Haaland is the man who can give him real competition, and if shove comes to push, even overtake him.

Closing Thoughts

Alongside Kylian Mbappé, Haaland might be the best young player in the world right now. He has all the necessary attributes to shine anywhere and is a transfer target for most of Europe’s big clubs. The 20-year old could potentially lead Barça’s front line for the next decade, and he could be Barça’s next iconic number nine, following in the footsteps of Luis Suárez, David Villa and Samuel Eto’o.

Erling Haaland dortmund

Haaland is set to dominate the decade, and Barcelona will regret not getting him. (Photo by Ina FASSBENDER / AFP)

He would surely astonish the Camp Nou, even without the so-called “Barça DNA”, but his transfer depends on navigating the financial crisis, and his on the pitch success depends on the right coach. However, just having Haaland on the team sheet, Barcelona would return to instilling genuine fear into their opponents.

Continue Reading