Learn how to make sports betting models to help improve and find your edge in the NFL, NHL, MLB, NBA and more!
Using data models and more, you can learn how to effectively wager to help reduce your losses, and eventually turn a profit. See how a great form of entertainment can become even more interesting.
The goal of this channel is to help broader the minds of anyone looking into sports betting, and trying to find ways they can create and develop their own betting process.
If you are interested in signing up for Unabated, you can do so here: unabated.com/?ref=mtzmzwj
Yes it definitely will, however it’s more of setting the value of a tie as a loss for the team you calc for. So if I’m trying to find the real prob of a win for team A and team B, and don’t count ties, I’d have to calculate each individually. I can also calculate the tie scenarios as well, but if it’s ties lose, and I want to calculate the prob to win, I’d calc team A and just 1-P(A) because it’s faster.
These are really good videos for basic statistical information that we can look to build models on, always enjoyed your content. Looking forward to the next why we use these and some practical applications.
Glad you’ve liked the content. I did receive lots of requests for starting with zero Excel and stat basics, so we are gonna do this series from nothing and just keep building up to models that can be modified for actual use
Hey T, thanks for the videos! In the string "ws.Range("B" & currentRow).PasteSpecial Paste:?xlPasteFormulas" I can't make out the character between the : and the xl. Would you be able to help? Thank you!
Not sure, but here is the section of the loop: For currentRow = formulaRow + skipRows + 1 To lastRow Step skipRows + 1 ws.Range("B" & formulaRow & ":H" & formulaRow).Copy ws.Range("B" & currentRow).PasteSpecial Paste:=xlPasteFormulas Next currentRow
hey, i know this is super late but i set up my poisson distribution but my table only sums to 99.98%. Is this how its supposed to be or did i do something wrong elsewhere?
Could be a rounding error, or a possible scenario you didn't grab that looks like a 0.0% but is actually more of a .0001 kind of number. Only other thing I can think of is that perhaps once of the cells that is calculating is referencing another value accidently.
It would be a count for whatever you are aiming for. So I’d target the column of outcomes =countif(L:L, “A”)/10,000 this would give the prob Away winning given the outcomes of the Monte Carlo
This can be used for other stats like receiving yards, and other stats that are non-discrete (non-count). This is more of an intro model which is why I used it for a discrete type of prop like receptions. For discrete, you would want to use more of binom.dist or poisson depending upon what specifically you are looking for.
The environment I use is PyCharm. There are several options out there, but for me I like the ease of PyCharm. Some have also tried using googles cloud options to not need to store and run locally, but I prefer to have it run on my machine.
It will be nearly the same. You won’t need to go find as much stuff to install or manage. As far as code, not sure how big the projects can go in their notebooks, but the code itself should all be fine
hi, im building a model just like this, to calculate the winning chances of Team A vs Team B, the optimal way of doing it is scrapping each player of each team individually?
It can be. It really depends upon what stats you think will have an impact on the outcome. if the way Player A plays impacts Player B. Then you would want to use player level stats. If you think team level stats are reliable to still calculate probability of winning, then you can stick with team level and other stats. Some sports, team level can be used, in others player level and play by play would be needed.
So, hopefully this is going to answer the question, if I understand it properly. All stats are descriptive. Then depending upon your question you are asking, the stat could be more predictive than another. The first step is to know what specific question you are asking to solve, then find related stats that independently or have co-linearity, to answer your question. If we were asking questions about the NFL, we could say weather stats, defensive stats, and offensive stats all can be combined and worked together to form predictions. So the past descriptive stats could then answer questions like How many receiving yards will player XYZ get since in the past we have seen these stats form certain patterns/trends, or using things like linear regression.
These videos have been fantastic, and you do a great job of walking through it, so it's not just copy and paste, you allow us to understand the entire process. Any chance that you could do a futures type model? (i.e. win superbowl, or season wins etc.) Thanks!
So, unfortunately a futures model for Superbowl/Season Wins is far more complex than what I honestly would cover, as it requires probabilities of teams winning different games, injuries, draft spots of teams (tanking), etc. I prefer to use Unabated season tool for finding edges in the market. I have a LOOSE model that gives me some ideas, then use the tool to guide further to find any decent bets. You could do a monte carlo sim where you were to do a power rating model, then sim each week of the season adjusting power ratings, which then adjusts the winner each week.
Hello, when trying to run my code just as you did 30:10, i get an Error response: File "parsers.pyx", line 574, in pandas._libs.parsers.TextReader.__cinit__ File "parsers.pyx", line 663, in pandas._libs.parsers.TextReader._get_header File "parsers.pyx", line 874, in pandas._libs.parsers.TextReader._tokenize_rows File "parsers.pyx", line 891, in pandas._libs.parsers.TextReader._check_tokenize_status File "parsers.pyx", line 2053, in pandas._libs.parsers.raise_parser_error File "<frozen codecs>", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 262: invalid continuation byte Do you have any idea how to fix it? It would be really appreciated as Ive already been trying ChatGPT to help me. Cool video btw!
The issue is with the format of the text/values in the file you have. They must have some kind of special charter. Often this can happen with player names. You can either clean up the values in the file, or use additional code to tell it to ignore the issues. I can get the line of code you’d need in a day, I need to grab from one of my other models.
Another great video, it would be interesting to see which football markets this could be applied to (soccer in the US). Do you have any experience/tips?
I attempted this and I get error "No such file or directory found: 'MLS Team Game Stats.csv'" This line is supposed to pull all the data from a csv on fbref right? What does the encoding part do. Where did you come up with that number and the name for the csv? Wim
The MLS file will contain urls that I want to loop through for the MLS data on fbref. You would need ne to create this file so that allow the scrapper to pull in the information. The encoding portion allows for unique characters to be properly handled by the Python script so it doesn't fail out if it see's a non-standard character in a name.
I literally used the same exact code on python as you did, and got the same output, but when I selected all and copied and pasted it into excel, it didn't turn into a table and instead stayed as code. What did I do wrong? Thank you!
So, usually once you paste it in for the first time, you will need to modify the data to match a table, however that setup should continue to exist. Did it at least paste in as some readable values, or is it all in column A with html?
@@wageredontilt1649It was just html in column a. So weird. I also switched the settings to split by column and it didn’t do anything. Thank you for responding!
@@Actapguru That is odd. The only other thing I would suggest is maybe point your excel to a website, and import html. Then give it a try by copying and pasting in the html from python. Not sure why it is only wanting to display it as html. The only other thing I can think is that the html is incomplete so it doesn't know how to render.
Sorry if this is dumb question, but how would you go about running this regression in a Monte Carlo sim? Would you randomize targets (if so to what upper range) and the probabilities and calculate the formula 10,000 times?
You’d likely want to randomize it all for the formula. So, I’d set it up to randomize targets, and probabilities, then take that value and put through regression formula and save the result. Then have the MC do it again, and so on for 10k loops. Then you’d plot or measure the results of those 10k scenarios.
They are both really solid books. I think everyone should read them that want to start to model. It helped me for my intro understanding. If you like the books, I’d also give him a follow on X. Has really good insights.
I am just using the inspect feature, which is in most browsers. So, if you are using Chrome, or Firefox, if you right click on the screen. The floating options will appear, and you click on inspect. That should open up the html on the screen.
Sorry it didn’t go into enough detail on the model building for you. What aspect of the model building piece were you hoping to find that wasn’t covered?
@@jefffriend1306 @jefffriend1306 Okay, thank you for the reply back! If there is anything specific that you were hoping to see on modeling, or sports betting that you don't see in any of my content, please let me know. I can try and work something up.
@@wageredontilt1649 right now I am trying to learn all I can about differnet models for different NFL stats. I really know nothing about any of it. Thanks for the reply!
For the FIP v AVG is displaying in the cell as a gut check when looking at your numbers, and the actual FIP is used within Esta RA/IP, which then cascades down into the other cells.
I’ve done differing props. When you say 1st down rushing prop, can you explain the prop a bit more? How many first downs? Who will get the first down? Etc
@@wageredontilt1649 yes my bad, I could’ve explained myself better 😂 and thank you a lot for replying too! I currently wanna make a model on which team in the nfl will get more rushing 1st downs than the other one. For example, let’s say it’s week 7 of the nfl season, and you have Baltimore at home and Steelers playing away. Which team will have a better rushing game as a team? As well, is there a way to implement a defense rank then use that rank against your prediction of your rushing 1st downs? Sort of like a Bayesian model
@StertyOG for something like this you will want to account for predicated score, and occurrence of runs in sets of downs. You’d also want to bake in the probability the defense gives up a pass v giving up the run, and bake in the distribution of yardage a team earns per run per down and what defense gives up.
It would depend upon what you set your pass fail probability too, as well what you mean better stats = lower probability. Do you have an example of data you see that happening with?
Is the IF for the p()? If so, it sounds like there is a reference key mistaken. Can you copy and paste the formula you have into a comment? I can take a look from there.
Hello, I find your file very good but since baseballpress doesn't work anymore it's really a hassle for lineup. Have you found a way to automate this search, whether it's to recover the lineups but also to recover the stats automatically on fangraph.thank you in advance
For a temporary fix, I created a full list of players on a new sheet, then set each line up field to be a drop down. I will look up the player line up from differing sites (depending which one will post first), and begin typing in the name, for the drop down to find the player. Unfortunately there are no sites I have found with an easy pull in structure. To get stats or lineups history, you will need to set up scripts via pyhton.
I vaguely recall a video of yours dealing with first inning runs/hits, is that still posted? I'm pretty sure I saw it a while ago on your channel but I can't quite remember.
You may be talking about the videos I did for Unabated. Those videos can be found below. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-SX2xANBCqsY.html
Enjoyed the video man - Ive been coding some stuff in Python for a couple of years, always on the lookout for new ways to get into working with sports data though - you mentioned this model/example is too primitive to be used for anything - do you teach how to learn the betting side or are you primarily teaching how to use the tech like excel/python to people who already have betting knowledge? Cos I'm somewhat familiar with the tech but not at all with the betting side of things and I guess that's what I'd be interested in knowing more about. Cheers!
So, many of my videos that cover the betting side are done in excel videos so you can see the formulas, and the how and why the math/stats work. When I say that the models I show can't be used to win, I mean the model at the state it is in. If you were to add/use differing stats with differing correlations and dependencies, you can beat the books. Any full developed and active betting models are not exposed as to not give away the edge that has been discovered. An example would be the NHL line up builder series I have. That model conceptually can win, however if you do exactly what I do in the video, it will not beat the book as you need more stats and relational data to get an edge on a sports book line.
Can you make a video on like budling a sports model, to predict like the final score in excel, and how to use use it to run monte carlo in python? if that makes sense. love ur channel
So, you would be able to use player line up data to create a team prediction; or you can use some basic team stats to build predictions (though not totally accurate) There are a few videos on the channel covering these.
putting in the random data instead of just importing some random stats made it pretty confusing tbh. and seems like more work for you also. maybe just use some random nba data next time.
The vise description contains the link for the sheet. As far as automation, you would need to update the with code either in excel or google sheet scripts
This video has sparked my curiosity. How does the Excel Line Up Model estimate possessions for players? As someone who runs a dream interpretation channel, I'm interested in how you structure and present complex information in your videos for better viewer engagement. I truly appreciate the detailed explanation provided in this video, and I've shown my support by liking and subscribing to your channel.
Using a standard possession formula, or data set, you can calculate how many possessions will exist for a player in a minute, then estimate the minutes the player will be on the court. Using that info, you can map out the how many the players on a team will likely have in a given game.