Placeholder Image

Subtitles section Play video

  • all right, so it's time for a challenge.

  • And today I'm gonna try to be betting sites using a I betting sites, just making way too much money today and it's time to set a stop to this.

  • So here's the challenge.

  • I'm gonna try to build a program that uses artificial intelligence to beat the betting sites by predicting the results ahead of time.

  • So that's the challenge.

  • I'm not sure that's entirely legal, though, but let's go software.

  • Do not let him blow this software.

  • Okay, so that's not actually what programming looks like.

  • Programming looks more like this.

  • So this point, you might be wondering how we're gonna be able to do this and we're going to use something called Machine learning to predict the results of tennis matches.

  • And then we're gonna bet on five different tennis games or matches.

  • Not sure what it's called.

  • Then we're gonna put in $1000 on each bet, and then we're gonna see if we can actually beat these betting sites or if we just end up losing hard.

  • I can kind of see either scenario coming true, but I really want to beat them, though, so let's start out just building it, All right, so it's now Monday and I finish this yesterday and I think it's working.

  • I'm not quite sure how, but I think it's working.

  • I feel I have no clue actually what I've put together here.

  • But let's not dwell on things like trying to understand how all this works in order to minimize the risk of losing money.

  • And let's just put it to the test.

  • Everything that I've used for this will be lengthened the description also in case you want to try it out yourself.

  • But now let's predict some games and let's start doing some gambling.

  • All right, so let's start out by just running our program to make our predictions.

  • All right, So here are the games that were gonna bet on.

  • We're gonna bet on jail.

  • Monfils versus Dominick PM, Stan Wawrinka or something versus Daniel Medvedev.

  • Dev.

  • And we're gonna bet on Rafael Nadal versus Nick Cure Dios Andre, Rube Live versus Alexander Severa.

  • And lastly, we're gonna bet on Roger Federer versus tennis Sand groom.

  • Not sure how to say any of those names, but that's what it sounds.

  • Right.

  • So perfect.

  • We're gonna bet on those five games, and I'm not gonna use real money because this might actually be illegal on it's not worth the risk.

  • All right, So if we take a look at this first game, which is Gail guy in Monfils versus Dominick PM, we can see that the odds on bet 365 are 1.3 times our money on Dominic Diem and 3.5 times our money on Gael Monfils and our script.

  • If we take a look at what our script actually predicted, it predicted that jail will win.

  • So we're gonna bet on the one that bet 365 essentially doesn't think we'll win because that's the one that they've said has 3.5 in odds.

  • So if we bet $1000 on him, we can potentially get 3500.

  • So we will win 2500 if he wins.

  • And if we bet on the 1st 1 then we just get 1.3 times our money so we'll just get 300 if we better 1000 s.

  • So that means that they think that Gael Monfils won't win.

  • So we're gonna bet against Bet 365 So this will be really interesting.

  • If we actually win this, then this script might actually be pretty good.

  • And since I pretty much have no interest in actually watching these games, I'm gonna play red dead redemption while this is going on in the background.

  • And then we're gonna come back and see who actually won.

  • All right?

  • So that did not quite go according to plan.

  • We lost our money, so that kind of sucks.

  • But we won't let ourselves be discouraged.

  • And we're gonna just bet more money because that makes total sense.

  • And this time we're gonna again be betting against who bet?

  • 365 things will win.

  • So we're gonna bet $1000 for 3.75 times the money this time on standby.

  • Branca vs the Neal Medvedev.

  • So we're gonna bet on Stan Wawrinka for the win.

  • Let's go.

  • Okay, Nice.

  • So this time we actually won.

  • We've beaten bet 365 ones, and they've been enough once, in total, we have bettered $2000 we're right now at $2750 which means that we've profited $750 which is pretty good.

  • Still, even though we lost the 1st $1000 that we better let's see what the next game will do, all right, so for this one, as we can see, our prediction is that the same as bet 365 and that is that Rafael Nadal will win and since we have the same prediction aspect 365 that means that we're getting shitty odds.

  • So we only have 1.16 times the money because Rafael Nadal is so favored.

  • But yet let's see what happens.

  • As good as it gets very well, okay, so not a huge surprise that Rafael Nadal won.

  • I know pretty much nothing about tennis, but I have heard about him and I know he's pretty decent, so not a huge surprise that he did win.

  • But now we're at $3910 in total and we bet at a total of $3000 which means that we've made a profit of $910 that's pretty good.

  • That means that we've made two out of three bets, which is also really good.

  • It means that the program is working quite Well, at least so far.

  • So what I'm thinking now is that we're going to just run through these last two games and we're gonna come back tomorrow with the final score.

  • Okay, so now we're all down with the bedding and we've bet it on a total of five games.

  • And out of those five games, we've actually won four of them, which is pretty insane.

  • And I do understand that, like, ideally, in order to test this properly works, we would have to do it in a way larger scale with way more games.

  • And that way we would be able to figure out that it's not just a fluke that this work this time, but I won't do that.

  • And I'm pretty happy with it.

  • Still, we betted a total of $5000 now we ended up with $6990.

  • And that means that we made a profit of $1990 which is really good on five total games of bedding.

  • And if we want to get a little bit Mathy on this, we could say that we made a 39% profits in a day and 1/2 and that's pretty good or like extremely good or a Y, in my opinion, so I'm very happy with that.

  • So that was a really fun built to Dio, and I just want to mention that I'm not at all an expert in machine learning or anything like that.

  • So don't get any ideas.

  • I did what pretty much any coder does, and that is.

  • I found a existing repo on get tub, and that's kind of what I used and that was created by Eduard Thomas.

  • And that will also be the repo.

  • They'll be linked in the description in case you want to try it out yourself.

  • And that's kind of more often than not, what happens when you're a programmer.

  • You very rarely have to actually write something out from scratch yourself.

  • Usually anything that you think of someone else will have built something for that before.

  • So I just want to recommend this repo and that you check it out.

  • It seemed to be working really well as you saw also this video, sponsored by Kite Kite.

  • There's an order completion engine for python that uses machine learning to provide the completions.

  • It integrates with tons of different text editors like Adam Visual Studio Code, Sublime Vim and Pie Chart.

  • It has a few really cool features, the 1st 1 being ranked completions, cuts, completions, assorted by relevance instead of popularity or alphabet or something like that.

  • And like I said before, they used machine learning to provide the completions, which is how they're able to come up with better suggestions than any other system that I've used.

  • And the second feature is the line of code completions, which means that it's able to complete full lines of code for you.

  • Third feature is called intelligence snippets.

  • Using their machine learning, they're able to suggest placeholder values for whenever you're calling different functions.

  • Lastly, we have co pilot, which means you no longer need to Google Python documentation.

  • Biggest copilot lets you see the documentation right with the new text editor or I D.

  • So I definitely recommend downloading kite and giving it a try.

  • There'll be a link in the description, so yeah, this was really fun.

  • One to Dio and I also want to mention that that little B roll section at the beginning, in case you want to see how that was off shots.

  • I did that with a guy called Peter Lindgren, and his channel would be linked in the description as well.

  • And you'll see a little thing somewhere here as well.

  • For his channel, that was a really fun one.

  • And if you want to see like a behind the scenes of how we did that, he has a video on that that will also be linked.

  • And there will be something in the description and everywhere else for that as well.

  • And lastly, before you leave, I want to mention something that I've created called Clean Code Friday, which is where I send out a short email once every week, every Friday.

  • That contains a few of the things that I've found throughout the week that are interesting or that I think are interesting for you to hear about things like productivity tips and tricks, coding tips and tricks.

  • Books of read articles of red podcasts have listened thio and really anything that I think you might enjoy.

  • So if you want to sign up to that, you can go to Caltech.

  • Don't calm, slash clean code, and you can sign up for it.

  • there.

  • They will also be a link to that in the description as well.

  • There's lots of links in this episode.

  • I hope you enjoyed it, and I hope we'll see in the next one.

all right, so it's time for a challenge.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it