Machine Predictions and Lacrosse
Tags: machinelearning, ai, sports, lacrosse
Published: 2021-03-08 18:11:42

So it's been almost a year since I've even touched this lacrosse prediction program. I've done other projects that caught my attention and of course dealing with things of the pandemic didn't help either. But I'm back at it with this project for a little bit. So here's a refresher and small update.

Last year I started working on a project to try and predict the winner of the NCAA division 1 mens lacrosse tournament. Then the pandemic happened and the lacrosse season was cancelled and I didn't really do anything with the project. 

Now, the lacrosse season has started again and I decided  to come back to this project and rework one of the aspects of it, the phase one of predicting game winners.

Phase one of my project was to have the program look at each teams stats and decide a winner based on those. It was surprisingly accurate in the shortened season of 2020. I think it was around 60% correct, not too shabby. But this year I reworked the code a little bit. It's still based on the stats but I've changed the amount of points a team gets for having the better stat.

The only reason behind the points for a certain stat is only what I think is important. I've been involved with lacrosse as a fan, player, and coach since 2004. It doesn't seem that long ago, but writing that number makes me realize how old I am. But I feel like I know what I'm talking about when it comes to lacrosse so I feel like the points I'm awarding are justified. Plus I still am tweaking them based on further thought.

The first big 'test' for the program was this past weekend. There were a lot of games on Saturday and I felt like a good testing session. So Friday night I ran a program to update the needed stats for every team so it was up to date. Then I ran the prediction program and kept track of who was playing, who the program thought would win and I made a decision on who I thought would win.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m0jo0m878y8kdea45pes.jpeg)

After 29 games there are some interesting things I found.
First off was how correct the program was. It was 54% correct on Saturday and a dismal 33% for the Sunday games. Just to compare I was picked right 64% on Saturday and was 100% on Sunday. Over the 2 days there were 14 games where I picked a different team than the program did. My question now is why did I choose different. Why would I not choose the team with the better stats?

I think part of the reason is that college lacrosse has a parity problem. In that except for a few exceptions, the classic teams such as Syracuse, Virginia, Johns Hopkins and Maryland more often then not win games. There are two examples I wanted to point out that illustrates the parity issue perfectly.

It was a game from a couple weeks ago; Utah vs. Loyola. The program picked Utah to win based on the stats. Utah had been putting up some pretty good stats the couple of games before this one.The other game was from this past Saturday; Vermont vs. Syracuse. Utah is in it's third season in Division 1. Syracuse is a powerhouse in lacrosse.They have won the championship 15 times! Vermont and Loyola have also been in Division one for quite a while. I'm not sure how long but it's been a lot of years. Loyola has also won the championship once.

Now for the program to Utah or Vermont doesn't seem strange just looking at the stats. But I think more so in lacrosse you have to look at the history of the teams to guess who might win. Vermont has historically been at the bottom to the low middle of the pack in Division 1. Loyola was in the middle of the pack until a few years ago. I feel they are firmly in the top of Division 1 now with Syracuse, among many others. So while according to the stats Utah and Vermont should have won, based on stats AND history I went with Syracuse and Loyola to win.

With the current version of predicting there are a couple things I'm going to add and maybe change in the coming days and weeks. Working on phase 2 of the project where I'm going to go more of a machine learning path, I'm going to have to think of some way to add history of the teams into the model to hopefully make more accurate predictions.

Working on this project has made me love lacrosse more and realize the huge mountain that needs to be climbed in this sort of AI application. But that doesn't make it any less fun figuring this stuff out.

If you have any comments or suggestions I would love to hear them!