Inspiration

Less than a month ago was when the Knicks won their first championship in multiple decades. Living in New York ourselves, it was a monumental moment for all and especially for all the die-hard Knicks fans that have been betting not only their money but their dignity too. However, even before the Knicks win, sports betting and especially Basketball betting has become a very popular activity amongst adolescents and young adults. I've witnessed my classmates chat about their bets on a specific team or player and ever since the crazy Knicks championship win, the amount of students betting have significantly increased. Me and my partner as psychology students are also aware of the dangers related to gambling such as the Sunk-Cost fallacy and Gamblers fallacy. In addition, students' brains aren't fully developed which can lead to impulsive decisions which can then lead to mistakes. For this reason, we came up with the idea of creating something that will at least help new sport betters make smarter bets.

What it does

All In uses an AI algorithm to calculate the percentage of an inputted bet succeeding. The results are different depending on the type of bet and many other factors such as rest days, win/loss percentage, and lead player health status. The AI also uses existing data from an online database (BALLDONTLIE). All this data is then used to come up with one final percentage of how likely the AI thinks that the bet will succeed. In addition, the AI provides significant factors that affect the percentage either being higher or lower than what it would be if that factor was null.

How we built it

For this project, we decided to go with the website path. On the surface, we had an html frontend and python backend. Using VSCODE, we first made the html index of the frontend which was relatively straightforward after identifying the core sections (type of bet, teams, spread, etc). For the CSS, we went with a basketball color aesthetic to match the theme and function of the website. The primary purpose of the JavaScript was to not only make the website more aesthetically pleasing but also less cluttered and easy for users. Finally, my partner worked on the back end which was a python code containing the database and functionality of each input section of the program. The python code is responsible for taking in all the gathered information and coming up with one final percentage.

Challenges we ran into

The main challenges we ran into were around wiring the app to real-world data and getting the small details of a multi-mode UI right. Since we built this during the NBA off-season, there was no live current-season data to pull, so we had to design around last season's completed standings and season averages from the BALLDONTLIE API. We also ran into two front-end bugs that took some hassle debugging: a glossary screen that wouldn't close because a CSS rule (display: flex) was silently overriding the browser's default handling of the hidden attribute, and a "Cannot read properties of undefined" error on calculations caused by a JavaScript object literal that evaluated label templates for all bet types at once (including one that referenced a player name field that only exists on player-prop bets) even though only one label was actually used.

Accomplishments that we're proud of

We're proud that the probability engine is fully transparent rather than an simple answer with no support for why or how. Every calculation returns a factor breakdown (season record, recent form, home court, rest, injuries) showing exactly why a number came out the way it did, which was a deliberate design choice to support informed decision-making rather than blind trust in a prediction that wouldn't be solving the original problem. We're also proud of results backed by live season-average data, and a parlay builder that combines multiple legs (team bets and player props together) into one combined probability. In summary we're proud of the website feeling like a complete, cohesive product rather than a bare-bones calculator.

What we learned

This project has allowed me and my partner to learn a lot, not only about coding and website development but ironically the system of sports betting. Learning how each type of bet worked and the necessary information was quite interesting (I'll still never do sports betting but nonetheless it was still interesting). On the technical side, we learned that building a "transparent AI" tool is harder than building an simple calculator. It's not enough for the model to output a number based on a series of variables and conditionals, every input has to be considered for the degree of impact it will make on the output and what factors combined will either multiply or divide or even cancel out.

What's next for All In

The most ideal next step for All In is expanding to other popular sports since Basketball isn't the only sport betted on. The World Cup is currently going on and that's bringing an entire new wave of sports betters so its a great opportunity for All In to shine. Besides that, an important addition could be a historical accuracy dashboard tracking how the model's predictions actually performed against real outcomes over a season. This addition can greatly build the trust factor that many potential users lack when it comes to AI algorithms (especially with their money).

Built With

Share this project:

Updates

Submission history