Inspiration
I am a huge fan of the NBA. Recently, I have been getting into sports betting, and it got me thinking, how could I maximize my confidence in placing a bet? I decided I wanted to put my ML skills to use; this would also give me a great opportunity to learn about ML and AI space, as this would be my first solo project.
What it does
This is a prediction model that will use all kinds of data from the games of a player's entire career to recognize trends and give a prediction on a stat. The model can predict points, rebounds, assists, steals, blocks, 3-pointers made, and free throws made.
How I built it
It started off as a simple regression model. It worked fine, but the predictions were not accurate at all. This is expected because a player's stats are not linear. After doing some research on how to make the model better, I decided that a neural network is the best and most accurate way to go. I then used an NBA API to access the stats for every NBA game played by a player. Just the player stats weren't enough, I also used the API to get team & defensive statistics for every team the player has ever played against to help the model better recognize trends. After many roadblocks and debugging, I was finally able to get the neural network working with surprising accuracy.
Challenges I ran into
The biggest challenge I ran into was merging all the information from all the NBA data. When I first made the model, it was working fine, but not predicting as well as I had hoped. I wanted this to be a thing that people could actually use. After many runs through, I realized that the CSVs containing all the team data were not getting registered. This was because some teams have changed their name over time, and all the teams have to be the same in each dataset for it to correctly merge. I had to go in and manually change the old names of teams to their current name, for it to merge properly. Another challenge I ran into was towards the end of the project, when I accidentally ran a line that corrupted the directory, which made the project unable to run. I had to basically start from scratch in a new, more secure directory, where I had to reinstall all the packages and convert the source code of the neural network to a working server.
Accomplishments that I'm proud of
The biggest thing I am proud of is that I went through with my word. This whole idea initially started off as a joke with my friends. We all started getting into sports betting at the same time, and I joked around that I would make a model that would make us money. I originally did not have any intention of actually doing that, but I was able to follow through on my word, and the model I created works much better than I envisioned. Despite all the struggles and bugs that were in the program, I never quit or lost motivation.
What i've learned
This being my first solo project, I have expanded my knowledge of full-stack programming greatly. I learned how a server works and how the frontend is connected to the backend. I also had some learning curves that weren't as good in the moment, but looking back, I am glad I had them. Accidentally corrupting my workspace was brutal and devastating in the moment, but I never stopped working. Learning what not to do is just as important as learning what to do. I am glad I have learned all these lessons about programming because I know I will encounter more in the future.
Log in or sign up for Devpost to join the conversation.