Posts

Town 1-2 Derby

My Summary A good performance in both directions marred by a mistake and some poor finishing. While it was influenced by Derby not needing to score for 65 minutes 1.94-0.57 is still a very good xG scoreline and really quite unlucky to get the result we did. Attack I’ve seen a lot of suggestions that last night we were poor going forward, or at the very least no better than we used to be; so let’s take a closer look at this claim. Last night we created 1.94 xG,which for a start suggests we were quite unlucky not to score a second; on balance either Kachunga or Schindler should have scored. According to xG, last season we only produced more chances to score on one occasion, away at Bournemouth (an oddly similar game, conceding two silly goals early on, then getting one back quickly but not being able to finish the job). This would suggest that this attacking display was improved from last season, but this result alone is nowhere near definitive. For a start we got a penalty, ...

A Plan B

Image
Recently I've seen more and more suggestions that it is time to move Mounie on, due to not fitting Seiwart’s system ; in my opinion that would be a mistake. It would leave Town without a viable plan B and take the club backward, to the same problem we had before Grant signed. So I want to look at Town's strikers and their style of play, to show where the similarities and differences lie. Quite often, for at least the last 2 seasons, Huddersfield have been criticised for lacking a plan B up front. During the majority of that time, the only 2 players used as strikers were Mounie and Depoitre, who have extremely similar styles of play, so much so that they seemed to cancel each other out when playing together. There’s clear evidence to show this:  I ran a clustering analysis on the attacking and build up data from 230 strikers in Europe's top 5 leagues to see just how similar they were. The results are below. Although the names aren’t very clear, it is important ...

Premier League Predictions 26

So now using version 3 Week 26 Predictions - Home Predicted Score Away Fulham 1-2 Man United Crystal Palace 1-0 West Ham Huddersfield 0-1 Arsenal Liverpool 2-0 Bournemouth Southampton 1-0 Cardiff Watford 2-1 Everton Brighton 1-0 Burnley Tottenham 1-0 Leicester Man City 1-0 Chelsea Wolves 1-0 Newcastle Still a lack of draws - I think I may need to change the data or at least the form it is in to help it predict more accurately. Not many surprising results here with most teams you would expect to win being predicted to and lots of tight games for the rest. Week 25  Review - Home Predicted Score Actual Score Away Tottenham 1-0 1-0 Newcastle Brighton 2-1 0-0 Watford Burnley 2-1 1-1 Southampton Chelsea 1-0 5-0 Huddersfield Crystal Palace 1-0 2-0 Fulham Everton 2-1 1-3 Wolves Cardiff 0-1 2-0 Bournemouth Leicester 1-0 0-1 Man United Man City 1-0 3-1 Arsenal West Ham 1-2 1-1 Liverpool Everton 0-1 0-2 Man City Another good week with 5 results and 1 corre...

Confidence - an xG viewpoint

Image
In the early months of the season Huddersfield were massively under-performing and the xg stats suggested that their form would increase dramatically and it did with 7 points taken in November but since then both actual and expected performance have dropped significantly and I think a possible explanation is confidence - that being below our xg totals for so long has actually made the squad believe in themselves less and thus produce less quality chances so our xg output sunk and thus are actual goals scored stayed low instead of rising up to the xg average. So I wanted to look and see if it is a common occurrence for clubs xg to move to meet ag rather than the other way round which is to the best of my knowledge what you would expect for a team under or over performing their expected goal scoring ability Take a look at 5 game rolling expected goals (xg) and actual goals (ag) for both Southampton and Huddersfield this season: Southampton as - 5 game rolling average actual goa...

Premier League Predictions 25

So now using version 3 Week 25 Predictions - Home Predicted Score Away Tottenham 1-0 Newcastle Brighton 2-1 Watford Burnley 2-1 Southampton Chelsea 1-0 Huddersfield Crystal Palace 1-0 Fulham Everton 2-1 Wolves Cardiff 0-1 Bournemouth Leicester 1-0 Man United Man City 1-0 Arsenal West Ham 1-2 Liverpool Everton 0-1 Man City Still no draws not sure why the behaviour is so weird around this - works perfectly fine for other seasons. Chelsea perhaps surpisingly only backed to beat Huddersfield by a small margin but mostly due to their lack of goals in recent weeks. Leicester's impressive performances against big six clubs recently mean they have been backed again against Man United. Week 24  Review - Home Predicted Score Actual Score Away Arsenal 2-0 2-1 Cardiff Fulham 1-0 4-2 Brighton Huddersfield 1-0 0-1 Everton Wolves 2-1 3-0 West Ham Man United 1-2 2-2 Burnley Newcastle 0-1 2-1 Man City Bournemouth 1-0 4-0 Chelsea Southampton 1-0 1-1 Crystal Palace Li...

Premier League Predictions 24

So now using version 3 a summary of its performances over recent weeks and its predictions for the upcoming games Week 17-23  Review - Week 17 - 7 results with 2 scores Week 18 -  3 results with 0 scores Week 19 -  6 results with 1 score Week 20 -  5 results  with 2 scores Week 21 -  3 results with 0 scores Week 22 -  6 results with 2 score s Week 23 -  7 results 0 scores Overall a fairly good set of results with just a few poor weeks in the middle. Scores very low with this model but getting a clear improvement in results. Running just above the average for last season with 37/70 results. Week 23 Predictions - Home Predicted Score Away Arsenal 2-0 Cardiff Fulham 1-0 Brighton Huddersfield 1-0 Everton Wolves 2-1 West Ham Man United 1-2 Burnley Newcastle 0-1 Man City Bournemouth 1-0 Chelsea Southampton 1-0 Crystal Palace Liverpool 2-0 Leicester Tottenham 2-1 Watford A huge surprise there with Burnley to win away at Man ...

Predictor Version 3

Version 3 The new predictive element I have calculated to be the best to use is a logistic regression machine learning element to predict result of a match. Followed  by taking the average xG scored and conceded by both the home and away team to produce an average value for the home team to score and away team to score which then uses a Poisson distribution with these numbers as mean to find the most likely score line with matching result to the first element. Naive Bayes and Results was selected by testing performance against 3 other predictors that use either Bayes or Logistic regression to predict either scoreline or result. The performance test was accuracy of predicting the correct result even if scoreline was used to train the data as ultimately that is what they are both trying to predict. Results shown below: ML\Predict Results Score Bayes 0.47 0.31 Logistic 0.50 0.47 So this is only a small improvement from the old version 2 predictor which got 0.46...

Does time of shot affect affect xG?

A major decision for managers of smaller clubs, who can’t just blow opposition teams away, is whether to go out quick at the start and try and get an early lead, then defend it or to keep it tight, before throwing everything at the wall for the last period of the match to try and snatch it at the death. Both methods have their benefits; the early attack gives more time to get the goal, but there’s no definitive end point as to when to start shutting up shop if the goal can’t be found as it’s unlikely a team would be able to keep up the intensity for a whole match. The late attack gives you more defensive security, as you prioritise not conceding in the early stages but can backfire if your opposition is fitter and have more in the tank at the end. What if it was possible to tell when is best to attack based purely on xG, if it could be shown that the time in the match affected how likely a shot was to be scored? It could help to decide when to attack to get the most out of it, or wh...

Huddersfield’s Possesion Problem

A link back to a thread I posted after the Cardiff game but seems still very relevant today https://twitter.com/colosslvictory/status/1034196536438087680 . We can't beat teams that sit deep and don't try to play, never have under Wagner and seemingly still can't. These teams turn up with a game plan to get a point and more often than not we are kind enough to give them all 3 for the troubles. The main problem is the pressing isn't as effective against them as they not only have the ball less so less opportunities but when mistakes are forced there is no space in behind to exploit and this leaves us out of options as we don't have a good enough delivery or patience to break these teams down. This also was a problem for Liverpool last season, although obviously not as badly), who also play the pressing game and they had a really hard time breaking down deep sitting opposition (H v Stoke, H v West Brom, A v Newcastle ) but this season they seem to have found a way ...

Premier League Predictions 17

Week 13-16 Review - Week 13 - 3 results with 1 score and unfortunately a most confident wrong, bad week overall Week 14 -  5 results with 2 scores and both most confident right, a good week as hitting target Week 15 -  6 results with 1 score and both 'bankers' right, good week as above target would like more scores though Week 16 -  4 results 1 score and both 'bankers' right Overall a fairly good set of results running only slightly below target for number of results, hoping to see a continued improvement as more data becomes available and thus it can be trained more. On the betting front it has fallen quite far down to -£5.60 overall loss (so £160 bet so far and still have £154.40) for the season so could be better. Week 17 Predictions - I can't get the graphic to work again so here is a table, unfortunately this means the predicted GD has been excluded and it is just the results. Home Predicted Score Away Most Confident ...

Premier League Predictions 13

Week 12 Review - A slight improvement this week and edging closer to the target of half of the results correct a week. This week the predictor got 4 correct results, 3 of which were correct score lines as well which is a shockingly high proportion. Once again we were denied a correct result (& score) in the early kick off by a 90+ minute goal, the early kickoff starting to become unlucky. This takes the tally to 58 results with 11 of them being correct scores. We also lost more money on the betting system this week as the results got were mostly straightforward with quite high odds for success (Man C, Liverpool, Spurs) and are now at a £.120 loss for the season. Week 13 Predictions - I can't get the graphic to work this week so here is a table, unfortunately this means the predicted GD has been excluded and it is just the results. Home Predicted Score Away Most Confident Brighton 1-1 Leicester Everton 2-1 C...

The problem with xG totals

There has been several reports in the media suggesting that despite Town’s impressive first half performance against West Ham they were in fact lucky to get a point in the end due to a number of high quality chances given away. Now when you look at the xG totals from the game it would seem to back this theory up with the xG score being: 1.19-2.04. The only problem here with these totals is that they take all context out of the individual chances when summing them up, it assumes all chances are independent for the relation to hold. Take Hernandez’s double chance just after half time where he takes a shot from close range which is saved before putting a header over the bar. Now he generates an xG of 0.49 and 0.57 for these two chances respectively, which would suggest that he has a 22% chance of not scoring, 50% chance of scoring once and a 28% chance of scoring twice. Although this can’t be true because how could he have scored two goals in that time there was only 1 second between ...

Premier League Predictions 12

Image
Week 11 Review - So all in all not the best first week to post about with just 3 correct results including 1 correct score. The 7 draws predicted did manage to catch the only draw of the weekend but  unfortunately for the predictor lots of teams who had been going through bad spells decided to show up; Newcastle, West Ham and Huddersfield (a result I am very pleased about though). This takes the tally to 54 results with 8 of them being correct scores. The bad week also means that we lost hypothetical money and are now down to £1.27 in profit over the course of the season - the Arsenal-Liverpool game making most of the difference to keep it in the green. Week 12 Predictions - The information in the central column is the predicted scoreline followed by the predicted goal difference. This week we have a much more even spread of results with 5 home wins, 2 draws and 3 away wins. Unsurpisingly the two most confident results are Liverpool and Chelsea at home to Fulham and E...

Premier League Predictions 11

Image
Each week I am going to try and remember to post my ML premier league predictor's predictions for the round of fixtures and keep track of how well it is doing in terms of correct results and scores. I will also be including a track of money won and lost if each predicted result was bet on. This will be done using my v2 for now but will transition to v3 when it is complete. I am starting 10 weeks in to the season as most teams have now played 5 home and 5 away games and thus the attributes fed to the machine learning algorithm should be fully populated and give more sensible predictions. Due to the way it is set up in very early weeks attributes like form can behave weirdly if a team has 0 points and another max even if it has only been 1 game. For comparison, so far the predictor has 51 results correct of which 7 of these have been correct scores. Betting £1 on each game's predicted result would have yielded a profit of £5.01 so far not including stake. Week 11 Prediction...

Expected Point Analysis of Huddersfield's First 8 Games

Image
Expected Points Here’s a quick look at the expected points from Huddersfield Town’s first 8 games this season compared to the corresponding games last season (Cardiff for Stoke) as well as our first 8 games last season. (The expected points would be higher if I had not included the expected goal total from the penalty awarded on Danny Rose, as it was never a penalty, but for the sake of objectivity I have left it in). First let's look at this season’s expected points compared to the corresponding fixtures from last year. I think the first thing it shows is that we were right to be worried after the first 3 games, the performances were clearly worse this season (also worse compared to our opening 3 games last season) and we hadn’t even earnt a whole expected point in that time, the results and performances were bad. I also believe that this has had a knock on effect as to how people have viewed the games since then, as a lot of people have seen the results not improve and ...

The Future

Problems and things to correct I think the most glaring issue is that the most likely result calculators logic is not wholly sound, as I think it has some dependent variables being treated as independent and thus the probabilities are not quite correct. For example: goal difference and probability a team scores and concede the corresponding values - if GD is 1 then probability of Team A scoring 2 and conceding 0 is clearly 0 which is clearly not the same as P(A scores 2)*P(A concedes 0). The same goes as for one team to score and other team concedes, they are clearly related.  Result and score are very different, it’s much easier to say a team will win a game than to say by how much, and the current system doesn’t really reflect this at all. It gives a predicted GD but if say team A is 0.5 xG better than team B does this mean to expect team A to win or draw. It may be better to predict the result first and followed by a score based on predicted goals.  There is a pretty b...

The Story So Far

The prediction algorithm has been through 2 main versions so far. I unfortunately don’t have the original anymore so can’t quantify how effective it was comparatively, all I can say is that it wasn’t as good as V2 but better than just predicting the most common score from the previous season every week. Version 1 A simple calculation of: total form diff * a + position diff * b + location form (home teams home form - away teams away form) * c + home advantage. The values of A, B, C and home advantage were all calculated by searching all values in a range to find the values that produced the highest total number of correct result over all previous games. A very slow process but it gave decent accuracy. Version 2 The predictive element was replaced with a system to predict the goal difference and another to convert that to a likelihood for each score line, so the one with highest probability can be picked. A linear regression algorithm is used for the predictive element, where a...

Introduction

For the last 2 seasons, I have been developing and using a football prediction algorithm; mostly to beat my friends in prediction leagues but also due to my own curiosity about how much a result can be preset before the game and if shock results are as shocking as they seem. I have decided to start writing about it now because; I’m about to make some huge changes to not only the algorithm used but the attributes and accuracy methods. I’ve also been slowly looking at and analysing other stats and information to try and explain some of the less straightforward decision clubs (specifically my own team - Huddersfield Town) make, as well as why some teams are doing well while others struggle.   For me blogging about these changes allows me to start doing that more formally, while giving my friends and family a break from my constant “statistics and computer science nonsense”.