Players rated by statistical algorithm

Pek

Registered User
Jan 3, 2016
13
0
Hi hockey people,

I have been working with an algorithm which rates hockey players by statistical data.

I think the results are pretty interesting.

You can see the ratings here: https://pekka.shinyapps.io/alex (I know it's slow :( , but be patient)

What do you think. Spot on or complete rubbish?
 

Bear of Bad News

Your Third or Fourth Favorite HFBoards Admin
Sep 27, 2005
13,555
27,161
Interesting stuff - thanks for posting, and welcome to the boards.

Mind explaining a bit more about what you did?
 

Pek

Registered User
Jan 3, 2016
13
0
Interesting stuff - thanks for posting, and welcome to the boards.

Mind explaining a bit more about what you did?

Thanks.

Well... I take these events from every game:
- goals
- penalties
- shots (including missed and blocked).

Then for each event I check the players on ice from both teams. Scores are then adjusted so that players gain from positive events and lose from negative events.

The trick is that your team mates and opponents are taken into account as well. So if you manage to score a goal against good players you will gain more than scoring against bad players. It should be equally easy to gain high rating in good or bad team. But of course good teams have more higher rated players because there are simply more better players in good teams.

See also, the about page in the website where I try to explain things more.

But yeah, questions are welcome. Don't blame you if my explanations are not clear :)
 

HugginThePost

Flames Suck
Sponsor
Dec 28, 2006
3,889
3,299
Back to the Sweat Box
I'm not too sure what to make of it. At first glance it's hard to justify some of the rankings.

I mean Hall is a great player, but the best in the NHL? No.

I'll have to read more about what you've done, in your "About" page.

EDIT: I guess if you are using shots as a metric Hall would be high. Isn't it a bit of a misleading stat though? Hall takes shots from all over the ice, some good, some bad. He's always trying to get the puck on net, which is why his shooting percentage is so low. Interesting that Ovechkin isn't higher than Hall as he scores more goals and takes more shots. You could also say that he does it with less talented line mates as well. Hall is surrounded by 1OA's.....not as good as him mind you, but still a talented bunch.

There are some that don't seem to make any sense though.....take J. Voracek, only 4 goals and 104 shots on net, yet you have him ranked higher than Johnny Guadreau who is for the most part Calgary's best player.

Anyway, I'm sure there has been a lot of work put into this, so job well done.
 
Last edited:

Bear of Bad News

Your Third or Fourth Favorite HFBoards Admin
Sep 27, 2005
13,555
27,161
So it's basically a mulitvariate linear regression? How do you determine the weights?
 

WhiskeyYerTheDevils

yer leadin me astray
Sponsor
Apr 27, 2005
33,742
30,074
Hi hockey people,

I have been working with an algorithm which rates hockey players by statistical data.

I think the results are pretty interesting.

You can see the ratings here: https://pekka.shinyapps.io/alex (I know it's slow :( , but be patient)

What do you think. Spot on or complete rubbish?

I'd say the fact that all of the lowest performing players are defenseman is a bit concerning. The top of the list also seems to bias towards offensive minded forwards.

Both of these observations leads me to think you may need to tweak your algorithm to account for other events, like faceoffs, takeaways, or blocked shots. You'd also want to adjust these for ice time.
 
Last edited:

Pek

Registered User
Jan 3, 2016
13
0
I mean Hall is a great player, but the best in the NHL? No.

Bear in mind that Hall is playing in Edmonton (one of the worst teams) but he is still doing very well (5th in P and 23 in +/-). The model does take into account that his team mates are worse than in the top teams.

Maybe Hall would crush in top teams.
 

Pek

Registered User
Jan 3, 2016
13
0
So it's basically a mulitvariate linear regression?

No it's not. I guess in multi.var linear regression you would need to have all the players as predicting variables (1000+). Then you would predict the outcome of the event by whoever was playing plus some additional indicators like PP etc.

I am not sure if a stable model could be built this way but probably possible. Maybe I should even try it.

This model is kind of "preference model". It works similarly as for example elo-ratings in chess https://en.wikipedia.org/wiki/Elo_rating_system

How do you determine the weights?
Duh. Just with some out of hat coefficients :) .
Goal is 2 and shots on goal vary between 0.1 - 0.4 depending on the distance and angle.
 
Last edited:

Pek

Registered User
Jan 3, 2016
13
0
EDIT: I guess if you are using shots as a metric...

Both of these observations leads me to think you may need to tweak your algorithm to account for other events, like faceoffs, takeaways, or blocked shots. You'd also want to adjust these for ice time.

Seems like I need to make this more clear on my about page...

Individual stats are not important.

It works so that ALL players on the ice are rewarded from positive events and punished for negative events. So you get points whenever something good happens for your team and you are on the ice. Regardless if you made it happen or your mate. So in that sense this is closer to +/- statistic than goals/points.

In fact you could say that it IS just like +/- but adjusted with these things.

-Competition (team mates / opponents)
-Zone starts
-Power plays
-Score of the game
-Also shots and penalties are included and not just goals

Interesting that Ovechkin isn't higher than Hall as he scores more goals and takes more shots. You could also say that he does it with less talented line mates as well. Hall is surrounded by 1OA's.....not as good as him mind you, but still a talented bunch.

Maybe it's those team mates... And well Ovechkin is lazy, isn't he? So probably gives away too much for the opponent compared to Hall.
 
Last edited:

Pek

Registered User
Jan 3, 2016
13
0
I'd say the fact that all of the lowest performing players are defenseman is a bit concerning. The top of the list also seems to bias towards offensive minded forwards.
You are right. I am not sure of the reason nor how to fix now.
 

Pek

Registered User
Jan 3, 2016
13
0
Not sure if that was meant to be a joke or not?

......and no, Hall gives the puck away more than Ovechkin.

I didn't intend that as so serious statement. Was merely trying to guess the reasons why Hall is higher than Ovechkin.
To be honest I have no clue who is better to def direction Hall or Ovechkin.

One of the original motivations was to find out about Ovi :) but that was a long time ago.
 

Mc5RingsAndABeer

5-14-6-1
May 25, 2011
20,184
1,385
This is really interesting.

Regarding Hall, is he being overrated because his teammate score is going off of overall performance rather than average performance? Draisaitl wasn't there for a large chunk of games.


Also can you make a minimum games filter?
 

Butcher

Registered User
Dec 7, 2013
1,076
0
The teammate rating looks like it might be an issue at first glance. In some cases where two or three good players play most of their time together, it looks like one or two are being heavily punished for playing with the other(s). Since you are measuring events that take place when players are on the ice, I would expect players of similar skill levels who spend >80% of their ice time playing together to have somewhat similar rankings.

A few cases in point (ice time percentages taken from Behind the Net, numbers in parenthesis are rankings from your model):

78.2% of Patrick Kane's (3) icetime is with Panarin (453), 85.6% of Panarin's is with Kane
88.5% of Seguin's (9) ice time is with Jamie Benn (112), 93.1% of Benn's is with Seguin.
90.2% of Henrik Sedin's (22) ice time is with Daniel Sedin (497), 85.9% of D. Sedin's is with H. Sedin.
78.9% of Johnny Gaudreau's (24) ice time is with Sean Monahan (803), 84.2% of Monahan's is with Gaurdeau.
Blake Wheeler (17), Andrew Ladd (516) and Brian Little (702) play as a full line ~80% of the time.

The Sedin example was what caught my attention. I think most non-statistical rankings underrate the Sedins, so when I saw Henrik at 22 (which I think is fairly reasonable) I checked where Daniel was. If you are ranking player performance, I think most would agree that the two should be within a couple spots of each other.
 

Pek

Registered User
Jan 3, 2016
13
0
The teammate rating looks like it might be an issue at first glance. ...

78.2% of Patrick Kane's (3) icetime is with Panarin (453), 85.6% of Panarin's is with Kane
88.5% of Seguin's (9) ice time is with Jamie Benn (112), 93.1% of Benn's is with Seguin.
90.2% of Henrik Sedin's (22) ice time is with Daniel Sedin (497), 85.9% of D. Sedin's is with H. Sedin.
78.9% of Johnny Gaudreau's (24) ice time is with Sean Monahan (803), 84.2% of Monahan's is with Gaurdeau.
Blake Wheeler (17), Andrew Ladd (516) and Brian Little (702) play as a full line ~80% of the time.

The Sedin example was what caught my attention. I think most non-statistical rankings underrate the Sedins, so when I saw Henrik at 22 (which I think is fairly reasonable) I checked where Daniel was. If you are ranking player performance, I think most would agree that the two should be within a couple spots of each other.

Thanks. These are interesting examples. My brother also pointed out the Sedins.

Now the model seem to think that Henrik Sedin is good and Daniel Sedin is bad but together they are fine. But maybe that is not true at all.

It might be that something like this is happening:
First HS got somehow higher rating than DS. Then when they are playing together HS gains more than he should because the model thinks that DS is bad (team mate effect). And similarly DS gains less than he should because the model thinks HS is very good. Then, if they are sticking with each other all the time, this error is never corrected but instead might get bigger and bigger.

I definitely need to look in more detail what is going on in these cases and if there is a possibility to tweak the model.

Anyway, these cases are hard where two (or 3) players are playing together nearly 100% of the time. Very difficult to distinguish them based on ice time. Initially, I thought that surely there is enough "separate" ice time for everybody to stabilize the ratings but I might have been wrong.
 

Pek

Registered User
Jan 3, 2016
13
0
This is really interesting.
Thanks.

Regarding Hall, is he being overrated because his teammate score is going off of overall performance rather than average performance? Draisaitl wasn't there for a large chunk of games.

Hmm I am not sure if I understand. If Draisatl wasn't there and someone worse was then from those games Hall gained even more from positive events.

Also can you make a minimum games filter?

Do you mean filter out players with only few games?
There is that already. Click the box under games and use the slider.

For ratings page there is no games filter but if you want to filter out the players with very few data points then use "ActionPoints" filter. ActionPoints is based on the amount of events (pos and neg) the player was involved in.
 
Last edited:

Mc5RingsAndABeer

5-14-6-1
May 25, 2011
20,184
1,385
Thanks.



Hmm I am not sure if I understand. If Draisatl wasn't there and someone worse was then from those games Hall gained even more from positive events.



Do you mean filter out players with only few games?
There is that already. Click the box under games and use the slider.

For ratings page there is no games filter but if you want to filter out the players with very few data points then use "ActionPoints" filter. ActionPoints is based on the amount of events (pos and neg) the player was involved in.

I'm not sure how you factored in teammates. Is it done after the fact or for each event that you are recording (using the teammate's rating at that point in time)?

Thanks for the games filter - didn't see that.
 

Pek

Registered User
Jan 3, 2016
13
0
I'm not sure how you factored in teammates. Is it done after the fact or for each event that you are recording (using the teammate's rating at that point in time)?

Team mates and opponents' ratings are considered at the time when the event happened.
 

Butcher

Registered User
Dec 7, 2013
1,076
0
It might be that something like this is happening:
First HS got somehow higher rating than DS. Then when they are playing together HS gains more than he should because the model thinks that DS is bad (team mate effect). And similarly DS gains less than he should because the model thinks HS is very good. Then, if they are sticking with each other all the time, this error is never corrected but instead might get bigger and bigger.

I definitely need to look in more detail what is going on in these cases and if there is a possibility to tweak the model.

Essentially it is generating a self reinforcing feedback loop. This was my first thought as well.
 

Pek

Registered User
Jan 3, 2016
13
0
Here is a more detailed explanation how the algorithm currently works and discussion about the problems (this ended up to be quite a heavy post... probably should've started with this.)

___________________

As I said before I have disregarded all individual statistics and look only the on ice stats. After all, ice hockey is a team sport. If a team scores a goal it's not always clear who really made it happen. Or furthermore if they concede a goal it's quite impossible to say whose fault was it only by looking at the statistics.

Doing it like this is very tempting because building a somewhat balanced model is quite straightforward. You can treat defencemen and forwards the same and don't have to worry so much about bias between different playing styles/positions.

However, there seems to be some problems which can't be solved without looking at the individual statistics :(
___________________

So the algorithm works like this:

For these events
- goal
- shot (including missed and blocked)
- penalty
- zone_ending
- shorthanded time / wasted power plays
do the following:

1) Calculate mean(rating) for both teams using the skaters on ice (in case of goal include the goalie rating)

2) Using those avg ratings calculate rating change according to the ELO-formula.

3) Multiply the rating change with: event weight, score weight, coordinate weight

4) In case of "not balanced" event (events after zone start, power play, empty net)
the rating changes are multiplied by correction coefficient to ensure that the average rating change is 0 in those occasions.

5) Finally this multiplied/corrected rating change is applied to all skaters on ice

Performance for each player is then calculated similarly but instead of using the players own rating average rating is used.
The motivation behind this is that it should be equally easy for high and low rated player to achieve a good performance.
________________________

The event weights are:
event_weights = {
'shot':0.25,
'goal':1.9,
'time':0.25, #one minute power play time
'blocked_shot':0.15,
'missed_shot':0.15,
'penalty':0.45,
'zone_ending':0.15
}

The score weights by score_difference are:
0 1.0
1 1.0
2 0.8
3 0.6
4 0.4
5 0.2

The coordinate weights range from 0.5 to 1.5 depending on the shot distance and angle.
____________________

Problems:

1) "The Sedin problem 1"
If two players are always plaing together then the difference in their ratings stays constant whatever happens.
This will lead to a problem when one of the players is underrated (or overrated).

For example, assume that Daniel Sedin has a way too low rating (as he probably does).
Then the algorithm tries to correct this but if D plays with Henrik all the time then H's rating will be pushed upwards also.
Now both H's and D's ratings will be pushed up until H is as much overrated as D is underrated and then the ratings stay there.
This problem wouldn't exist if the team mates/lines would mix enough but sadly that's not always the case.

2) "The Sedin problem 2"
The highest rated player always get's the most performance points from each event. This happens because if you take all players from one team then the best player has worst team mates :)
If a very good and a very bad player achieve a same result together then the very good player has played better than the bad player because he has bad team mates.

3) Lack of individual statistics will cause inaccuracies
For example if one player takes a stupid penalty/makes a great goal then all his team mates are punished/rewarded equally.
I think this is only a minor problem in the long run (IF the players are sufficiently mixed).


I think these problems are impossible to fix without looking at the individual stats so that's probably what I will try to do next.

However, mixing in the individual stats is somewhat hard because there is always a danger that the model will reward some playing style more than other even though it would not be better for the team in the end.
Also, many important stats (like passes and their coordinates) are seemingly not tracked by NHL at all.

But anyways... stay tuned.
 
Last edited:

Edmonton East

BUT the ADvaNCEd STatS...
Nov 25, 2007
6,491
2,447
Bear in mind that Hall is playing in Edmonton (one of the worst teams) but he is still doing very well (5th in P and 23 in +/-). The model does take into account that his team mates are worse than in the top teams.

Maybe Hall would crush in top teams.

I would consider this line of thought a mistake, though. You are making a lofty assumption that worse teams in terms of points, mean the player is at a disadvantage. Just a few of the issues with that:

1) Teams with low point totals don't necessarily have trouble scoring goals
2) Teams that routinely get pounded every other night may have easier scoring opportunities when games are out of hand. ie a goal vs Hall in a 3-2 game is more important than a 5-1 game, regardless of who is on the ice.
3) Since a large part of this seems to rely on strength of opponents on this ice, how are you determining this? A guy could be out against a teams 3rd line, but that line might be their shutdown line.
 

Stand Witness

JT
Sponsor
Oct 25, 2014
9,632
2,716
London, ON
Seems to definitely be accurate in telling us what is happening right now and just in the past. I do question its ability to predict future success somewhat because I noticed Komarov rated fairly high and I think anyone with any idea of how statistics work would rate him as one of the most likely to decline in the near future.

Regardless after just taking a quick look it seemed to be fairly accurate with how I would expect players to turn out.

I guess my only question is if you intended for your algorithm to predict future success or to only quantify past success? If yes to predicting future success, I am curious if you have any plans to help eliminate outliners (Komarov) who we would expect to decline soon.

I did notice that D-men are coming out as terrible performers on your list? Any specific reasoning? Sorry I didn't get to really read any of the thread I was just responding quickly before I go to work.
 

Ad

Upcoming events

Ad

Ad