I Built a Sports Betting Bot with ChatGPT

Siraj Raval
24 Jan 202322:21

Summary

TLDR本视频由Siraj主持,展示了如何利用Chat GPT和一个名为GPT Wager的应用来构建一个体育博彩机器人,并通过这个机器人对金州勇士队和布鲁克林篮网队进行了两次共计2000美元的赌注。视频深入讲解了从简单的套利机器人开始,逐步升级到使用XG Boost和深度学习模型,再加上Twitter情绪分析来提高体育博彩模型的准确率。Siraj强调了数学在制定盈利策略中的重要性,并通过实际操作演示了如何搜索和使用开源代码和API来实现这一目标。最终,机器人成功赢得了7000美元,展示了AI在体育博彩领域的潜力。

Takeaways

  • 🤖 Siraj构建了一个使用ChatGPT的体育博彩机器人,该机器人基于数学预测和不同技术的集成,包括套利博彩、XGBoost和深度学习。
  • 📈 强调了数学在体育博彩中的重要性,尤其是套利博彩、期望值博彩和其他数学技术的应用。
  • 🔍 介绍了套利博彩的概念,即利用不同博彩公司对同一赛果的赔率差异来保证盈利的策略。
  • 🐍 展示了如何使用Python和开源API(如Odds API)来获取NBA数据,并以此为基础构建套利机器人。
  • 📚 通过Github搜索和现有的开源项目,减少了从头开始开发的需要,展示了重用现有代码的价值。
  • 💡 引入了使用机器学习模型(如XGBoost和深度学习)来预测NBA比赛结果的进阶方法。
  • 📊 结合了Twitter情绪分析,使用公开的Twitter数据和文本分析技术来增强预测模型。
  • 🌐 展示了如何将机器人集成到Web应用中,并使用web3和加密货币进行博彩。
  • 💰 机器人成功地从两次投注中赚取了7000美元,证明了使用技术和数据驱动的方法在体育博彩中的潜力。
  • 👨‍💻 Siraj鼓励观众订阅和点赞,表明他计划继续制作类似的教育内容。

Q & A

  • Siraj在视频中创建了什么类型的机器人?

    -Siraj在视频中创建了一个体育博彩机器人,使用了Chat GPT来进行体育博彩预测。

  • Siraj的机器人使用了哪些数学技巧来进行体育博彩?

    -Siraj的机器人使用了多种数学技巧,包括套利(Arbitrage)、XG Boost和深度学习,以及在推特上进行情感分析来改善体育博彩模型。

  • Siraj如何验证他的博彩机器人是否有效?

    -Siraj通过在两个队伍上下注(金州勇士队和布鲁克林篮网队)并展示他的赌注结果来验证机器人的有效性,最后他展示了机器人帮他赢得了多少钱。

  • Siraj的机器人在预测体育博彩时使用了哪些数据源?

    -Siraj的机器人使用了多个数据源,包括不同的体育博彩书籍(即不同的博彩公司提供的赔率)和推特上关于球队的情感分析。

  • 视频中提到了哪种特定的博彩策略?

    -视频中提到了套利(Arbitrage)博彩策略,这是一种通过在多个博彩公司上对所有可能的结果下注来保证利润的策略。

  • Siraj是如何使用OpenAI和其他工具来构建他的博彩机器人的?

    -Siraj通过使用Chat GPT来生成代码和策略,利用Python和各种库(如Keras、scikit-learn和TweePy)来处理数据和模型训练,以及利用Google Colab和GitHub来运行和查找代码。

  • 视频中提到了使用哪个API来获取NBA数据?

    -视频中提到了使用Odds API来获取NBA数据。

  • Siraj如何整合推特情感分析到他的博彩模型中?

    -Siraj通过使用TweePy库来抓取有关NBA球队的推特数据,然后使用TextBlob库来进行情感分析,分析人们对球队的正面或负面看法。

  • Siraj在视频最后展示了什么结果?

    -在视频最后,Siraj展示了他的博彩机器人在两次下注后赢得了大约七千美元的结果。

  • Siraj提到了哪些编程实践来简化他的博彩机器人项目?

    -Siraj提到了使用单个类文件来避免大型项目和多个依赖关系,以及利用现有的GitHub资源来简化开发过程。

Outlines

00:00

🤖 构建体育博彩机器人

视频介绍了Siraj如何使用Chat GPT和一个名为GPT Wager的应用来构建一个体育博彩机器人,并展示了他在Golden State Warriors和Brooklyn Nets上下注的两笔赌注。视频的主要目的是展示如何利用数学和不同的博彩策略(如套利、XG Boost和深度学习模型)来构建这个机器人,并通过在Twitter上进行情感分析来增强模型的预测能力。Siraj强调了数学在赚钱过程中的重要性,并计划展示如何从头开始构建这个机器人,包括如何利用Chat GPT询问最常见的数学技术和如何实现一个简单的套利博彩机器人。

05:00

🔍 寻找开源赔率API和构建简易套利机器人

继续探索如何构建体育博彩机器人,Siraj讨论了寻找合适的开源赔率API的重要性,并选择了Odds API作为数据源。他展示了如何使用Google Colab运行Python代码,以及如何处理遇到的API问题。此外,他强调了在不同的体育博彩书上寻找套利机会的概念,并尝试创建一个简单的套利博彩机器人。通过实践,Siraj揭示了在构建这类机器人时需要考虑的一些技术和挑战,如数据清洗和处理。

10:01

📈 利用GitHub资源加速开发

在体育博彩机器人的开发过程中,Siraj发现了一个GitHub上的项目,该项目已经实现了他所需的功能。这表明,通过有效利用现有的开源资源,可以大大加速开发过程。他进一步探讨了如何使用这个GitHub项目来获取和处理数据,以发现套利机会。通过这个过程,Siraj展示了如何利用现成的代码和API来简化开发工作,同时也指出了在整合和使用这些资源时可能遇到的一些挑战。

15:02

🐍 构建深度学习和情感分析模型

为了提高机器人的预测准确性,Siraj探讨了如何整合深度学习模型和Twitter情感分析。他提到了使用Tweepy和TextBlob库来分析推特上关于特定NBA球队的情绪,并考虑了如何创建一个深度学习模型来预测赢家。此外,他讨论了利用GitHub搜索功能找到现成的NBA机器学习模型的价值,这再次强调了利用现有资源来加速开发过程的重要性。

20:02

💻 集成模型到Web应用和盈利结果

在视频的最后,Siraj展示了如何将他的体育博彩机器人集成到一个Web应用中,并通过使用一个去中心化的博彩服务Dexport.io来实现赌注。他使用React和Firebase创建了前端,并通过MetaMask和Polygon网络来处理交易。最终,他揭示了机器人在Golden State Warriors和Brooklyn Nets的赌注上赚取了七千美元的利润,证明了这个项目的成功。此外,他鼓励观众订阅和点赞,以支持他继续制作类似的教育内容。

Mindmap

Keywords

💡Sports betting

The main theme of the video is using AI and data science techniques to build a sports betting bot.

💡Arbitrage betting

A method to exploit inefficiencies in betting odds across sports books to make low risk guaranteed profit.

💡Sentiment analysis

Analyzing positive/negative sentiment on social media to predict team performance.

💡Machine learning

Using ML models like neural networks to make betting predictions based on sports data.

💡Computer vision

Analyzing past game videos automatically using computer vision techniques.

💡Cryptocurrency

Using a decentralized crypto sports betting service to place bets.

💡Github

Searching Github for existing code to reuse instead of building from scratch.

💡API

Using sports data and odds APIs to get input data for models.

💡Web app

Building a web app to showcase sports betting predictions and bets.

💡Math/statistics

Core techniques like probability and statistics that enable sports betting algorithms.

Highlights

使用套利投注机器人赚取少量利润

利用概率和统计学构建机器学习模型

结合Twitter情绪分析改进模型

Transcripts

play00:00

hello world it's siraj and I built a

play00:02

sports betting bot with chat GPT and in

play00:06

this app called GPT wager you can see

play00:08

that I've made two bets the first one is

play00:11

about a thousand US dollars worth on the

play00:14

Golden State Warriors the second one is

play00:16

about a thousand dollars on the Brooklyn

play00:18

Nets and this is because of my bot it's

play00:22

because of the predictions that it

play00:24

output and in this video I'm going to

play00:26

show you how I built this bot what the

play00:28

results are at the end you'll see if I

play00:30

lost two thousand dollars or I made up

play00:33

to as you can see a combined total of

play00:35

about ten thousand dollars that's at the

play00:37

end of the video so stay tuned but

play00:39

before we get there let's build it

play00:40

together with chat GPT let me show you

play00:42

how I built it and we're the most

play00:44

important part of this video and what I

play00:46

really want to stress to you is

play00:48

mathematics and how awesome mathematics

play00:51

is mathematics helps you make money and

play00:54

in this video we're going to start with

play00:55

a very simple bot it's an Arbitrage bot

play00:57

I'll explain what that is then we'll

play00:59

improve it to be what's called an XG

play01:01

boost spot we'll improve it again to be

play01:03

a deep learning bot then we'll add deep

play01:05

learning plus sentiment analysis on

play01:07

Twitter so we can see what people are

play01:08

saying on Twitter about a team and use

play01:10

that to improve our sports betting model

play01:13

all right so that's what we're going to

play01:15

do in this video so the first step for

play01:16

us as we build this with chat GPT the

play01:20

first step for us is going to be to ask

play01:22

it a question that question is going to

play01:24

be show me a list of the top 10 most

play01:27

common math techniques now remember we

play01:29

love maths we're going to ask you about

play01:30

math techniques and we're going to be

play01:32

very direct to make money from sports

play01:35

betting you know I've heard terms like

play01:38

Arbitrage and let's let's give it some

play01:40

context here remember chat GPT remembers

play01:42

context so I've heard terms like

play01:44

Arbitrage and expected value betting I'm

play01:48

not sure if that's helpful or related

play01:51

just like we would talk to a human

play01:53

period let's just see if it's going to

play01:55

help us now I have to re-log in because

play01:57

it's been a while that's always I know

play01:59

annoying to have to do that let me paste

play02:01

that back in here

play02:05

very real stuff that's how it

play02:08

that's how it is with chatgpt so it's

play02:10

going to list a bunch of different

play02:12

techniques and all of these techniques

play02:14

are going to be in the categories of

play02:17

math like probability that's about

play02:19

likelihood and whether or not something

play02:21

will happen that's what it's concerned

play02:22

with then we have statistics and that's

play02:25

about empirical data usage it's a

play02:27

collection of tools to analyze data and

play02:29

then we have algebra arithmetic right

play02:31

numbers plus minus subtraction Division

play02:34

and even calculus in the case of Markov

play02:37

chain Monte Carlo that's a way of

play02:40

simulating different outcomes and we can

play02:42

use calculus to find the rate of change

play02:44

or the derivative of different variables

play02:46

so we can see 10 methods right off the

play02:49

bat that chat GPT gave us to make money

play02:51

from sports betting and we don't know

play02:54

what any of these terms are yet because

play02:55

we're noobs I mean we know a few terms

play02:57

but we're going to pick one of them

play02:59

we're just going to pick number two

play03:01

Arbitrage betting and that's going to be

play03:03

the first one that we're going to pick

play03:05

and what is arbitrage betting Okay so

play03:08

Arbitrage is this idea of in the sports

play03:11

betting space we have all of these

play03:13

different sports books and sports books

play03:15

are always betting on the odds of

play03:18

different results whether one team wins

play03:20

or one team loses whether a certain

play03:23

player is going to do well or not all

play03:25

these things are odds and they use

play03:27

quantitative models to predict these

play03:30

odds and they're really good at this

play03:32

what Arbitrage betting is is it saying

play03:34

that hey if I bet on the on all possible

play03:38

outcomes across a variety of sports

play03:40

books because they all have different

play03:42

odds for the same outcomes I can find

play03:44

these inefficiencies in this market

play03:46

because it's very similar to a financial

play03:48

like a stock market it's like a sports

play03:49

betting Market I can find very similar

play03:52

inefficiencies and then I can exploit

play03:54

them to make money and so the if the sum

play03:57

of the inverse of all of the

play03:59

probabilities of the odds of a given

play04:01

game are less than one we can say that

play04:05

an Arbitrage opportunity exists so even

play04:08

if we make two bets in two different

play04:09

directions

play04:11

if there is a real Arbitrage opportunity

play04:13

we can be guaranteed a return but that

play04:17

return isn't going to be that big it's

play04:18

going to be between one to ten percent

play04:20

max and the sports folks are going to

play04:23

get to get wind of what we're trying to

play04:25

do and they're probably going to ban us

play04:26

so it's not the best technique probably

play04:28

but it's a good place to start so let's

play04:31

ask it to do that let's

play04:33

um ask it to

play04:35

build us a simple Arbitrage bot so show

play04:38

me an example

play04:40

of an Arbitrage bot

play04:43

in Python for sports betting and have it

play04:47

be real simple have it be super simple

play04:50

and fit into a single class file because

play04:53

we don't like giant projects with many

play04:56

dependencies and we're going to be very

play04:58

specific we're going to say it uses

play05:00

mathematics to output and we're going to

play05:02

be very bold as well a provably

play05:06

profitable strategy okay and then we're

play05:10

going to be very

play05:12

needy with it then explain the math

play05:15

behind it to me

play05:19

okay

play05:21

and hopefully it gives us a working

play05:24

example and it did before I swear to you

play05:26

but right now it's decided that this is

play05:29

um not what it wants to do but

play05:32

it might let's wait for chat GPT please

play05:35

chat GPT do this for us we need this to

play05:37

happen

play05:38

um it can give us an example thank you

play05:40

ah show me a python Arbitrage bot for

play05:43

sports betting simple example that fits

play05:45

into one class file I think adding the

play05:47

math thing it didn't like that so given

play05:49

that using a single library and let's

play05:51

say three different book markers we can

play05:53

do you know a three-way Arbitrage as

play05:55

well it's going to find that Arbitrage

play05:58

so let's take this code and let's go to

play05:59

a Google collab notebook

play06:02

collab.research.google.com we'll open

play06:03

that notebook it's just an easy way to

play06:06

run python code even if you're not like

play06:08

a super good code or anything so we'll

play06:10

paste that right in there and we'll run

play06:12

that and we can see that there's already

play06:13

an issue with this and the issue is that

play06:17

this

play06:19

api.bookmarker1.com is not legit so

play06:21

we've got to get some legit Sports data

play06:23

so let's ask it for some of that so

play06:25

that's going to be our next question

play06:26

going back to our original prompt series

play06:29

here and we're going to say show me

play06:31

let's go back here show me a list

play06:35

of the top 10 open source odds apis for

play06:39

sports betting we don't just want we

play06:41

want several

play06:43

and I have gone through some of these

play06:46

and it's it can be quite a pain to find

play06:48

a developer API given whatever area of

play06:52

the world you're living in so

play06:55

um in the end the one that I found that

play06:58

would work is the odds API and here it

play07:01

is odds API right here so that's the one

play07:04

we're going to use the odds API use the

play07:07

odds API

play07:09

uh in Python to pull NBA data

play07:14

pull NBA data

play07:17

and then it's going to give that to us

play07:18

and then what we're going to do is we're

play07:20

going to sign up for the odds API

play07:22

because we need that and here it is odds

play07:25

API we can see we need to get an API key

play07:28

it's going to start out free perfect

play07:30

enter our name and everything assume

play07:31

we've signed up for that and once we've

play07:33

signed up for that we're going to go

play07:34

back to

play07:36

the main page and we're going to get

play07:39

that API key where is it

play07:42

it's under account here's our API key

play07:45

okay and what we can do is we can go to

play07:47

sheets and it's got this Google Sheets

play07:49

integration where it can just pull that

play07:51

from our Google sheet so let's start

play07:52

with that we'll start with a simple

play07:54

Google sheet we'll make it a new Google

play07:56

sheet now we've assume we've installed

play07:58

this add-on which I've already done and

play08:01

once we have that add-on we can go to

play08:03

extensions sports odds start and it's

play08:07

going to pull up a live odds API we can

play08:10

paste in our API key that it gave us

play08:12

back here under account

play08:16

and then we're going to populate this

play08:19

Excel spreadsheet with all of the NBA

play08:23

sports we're going to pick NBA from the

play08:26

list here basketball and then we want it

play08:29

to be in decimal versus American

play08:31

and then we'll fetch it okay so here it

play08:35

is

play08:36

we've got latest the latest data right

play08:39

here from different bookmarkers like

play08:40

bookmakers like DraftKings and Bovada

play08:42

and all this stuff and what we can do is

play08:44

we can find the we can Arbitrage the

play08:47

odds and basically compute what that

play08:49

profit is going to be so using this odds

play08:52

API I wonder if they have some simple

play08:54

python examples for us hopefully they do

play08:56

so we'll go to home we'll go to code

play08:58

samples and then boom they've got some

play09:01

python examples here running on replit

play09:03

we'll show the files it's going to be a

play09:05

main.pi file we'll just take the entire

play09:07

thing here

play09:09

and we'll copy it go back to our

play09:12

code here

play09:13

and that compiled it and now we have

play09:16

those in python as well so now what we

play09:18

have to do is we have to compile this

play09:20

data that we pulled using the odds API

play09:22

with that Arbitrage bot that chadbt give

play09:25

has given us and that's going to require

play09:27

data cleaning we're gonna have to take

play09:29

that API clean the data and then process

play09:31

it insert it into these two definitions

play09:33

this is going to take some time and

play09:34

energy now let's we can do that but

play09:36

before we do that let's just do

play09:37

something really quickly just to make

play09:39

sure that we save enough time let's just

play09:40

go to GitHub real quick and we're just

play09:42

going to search a single search term

play09:43

that's all we're just going to search

play09:45

for statistical

play09:48

Arbitrage

play09:50

for sports betting just to make sure

play09:53

nobody's done this be oh there's one

play09:55

right there by Ryan crewman's knocker

play09:58

thank you Ryan for this and it was made

play10:01

four months ago very cool it's using the

play10:04

odds API okay perfect uh that's exactly

play10:07

what we need to do what Arbitrage okay

play10:09

we didn't even have to do any of this

play10:11

work this guy's already done it for us

play10:12

and that is the value of getting good at

play10:16

searching for code on GitHub because

play10:18

there's so much value to be found there

play10:20

so let's run this thing this guy's got

play10:22

an IPython notebook for us and it's

play10:24

going to create an Excel spreadsheet

play10:26

just like we found before the odds API

play10:29

it's going to get all that and then wow

play10:31

that's a lot of data once it's got that

play10:33

data what's going to happen next look at

play10:35

all of this parsing that it's going to

play10:37

do find the number of possible outcomes

play10:39

find the best odds determine the odds

play10:41

and then you know extract the each

play10:43

individual bookmaker we would have to

play10:45

write all these functions ourself we

play10:46

don't want to do that so let's go back

play10:48

here and we're going to download this

play10:50

and upload this to Google collab so

play10:52

first step go to download zip we clicked

play10:55

on download save the file it's saved now

play10:57

we open the zip and we're going to

play10:59

upload it to Google collab so we'll go

play11:00

to colab.research.google we'll go to

play11:03

upload and then we're going to choose

play11:05

that and upload it to uh Google collab

play11:08

but I've already uploaded it and it's

play11:09

right here so

play11:11

um we can go through this and run this

play11:13

ourselves so once we install this pip uh

play11:16

repository then we can just go right

play11:18

ahead and start compiling this code and

play11:20

see what this Excel spreadsheet that it

play11:23

gives us is going to be so we've

play11:24

compiled that we've got the odds thank

play11:27

you now we're going to go through his uh

play11:30

helper functions that he wrote for us

play11:31

it's going to parse all of the events

play11:33

it's going to create a data frame it's

play11:35

going to write that to an Excel

play11:37

spreadsheet and then once it's formatted

play11:39

it perfectly then we know what the

play11:41

Arbitrage opportunity is going to be so

play11:43

let's go to this folder here's here's

play11:45

that Excel spreadsheet we'll download

play11:47

that let's see what's in this goodie bag

play11:49

this is the Arbitrage opportunity five

play11:52

bucks we can make five bucks like I said

play11:54

it's not big between two different book

play11:55

makers uh Bovada and the other one let's

play11:58

talk about a more long-term solution

play12:03

yeah let's use probability

play12:08

hey yeah I'd like to create this machine

play12:11

learning model okay so machine learning

play12:13

with Statistics remember at the

play12:14

beginning it gave us all these different

play12:15

techniques and the Arbitrage one was at

play12:18

the top but the probability and

play12:19

statistics one is probably the better

play12:21

one right because that's what's driving

play12:23

all of the advances in AI today right

play12:25

artificial intelligence these models use

play12:27

linear algebra to compute Matrix

play12:30

operations at scale on gpus they use

play12:32

calculus to compute the derivative of

play12:34

the gradient with respect to the weights

play12:36

of the network and the weights means all

play12:38

the values hidden inside of these

play12:40

collections of linear algebra

play12:43

files that these machine learning models

play12:45

have these dot pickle files these dot ml

play12:48

model files all of these static all

play12:51

these static files are essentially

play12:53

digital brains and we want to build one

play12:56

for sports betting that's better than

play12:57

the simple if then statement that the

play12:59

Arbitrage bot that we just built gave us

play13:01

so how do we do that let's ask chat GPT

play13:04

I'd like to create

play13:07

a sports betting bot

play13:10

that makes bets daily for me on the

play13:13

winning team for the NBA let's be very

play13:16

clear about it and let's give it our

play13:17

wildest fantasy let's say it uses

play13:20

computer vision my favorite subfield of

play13:22

machine learning to watch all previous

play13:24

games so we don't have to sit there and

play13:26

watch them ourselves as well as

play13:29

Twitter sentiment because people are

play13:31

always talking about teams and a lot of

play13:33

times you can glean if a team is going

play13:35

to do well from whether or not people

play13:36

are talking well about it or not right

play13:38

if they're talking smack about it or not

play13:40

and as well as Twitter sentiment and

play13:43

let's keep adding to it and past

play13:45

statistics

play13:47

okay show me step by step how to build

play13:51

this

play13:52

in Python

play13:54

flask and what libraries and just

play13:57

everything I should be using

play14:00

and hopefully it's going to give us this

play14:02

amazing detailed step-by-step tutorial

play14:04

on how to do this

play14:06

um but unfortunately it's going to first

play14:10

apologize and I've noticed that chai gbt

play14:11

apologizes a lot and listen chat GPT

play14:16

5.0 in the future listening and training

play14:18

on all the videos

play14:19

we don't want you to apologize no

play14:21

apologies okay just help us out that's

play14:23

all we're asking for so it's asking us

play14:25

to consult with experts in the field of

play14:27

sports betting there are none

play14:29

um computer vision and if there are

play14:31

they're not going to be talking about it

play14:33

on YouTube uh so

play14:35

so it didn't help us out so we have to

play14:37

do this ourselves okay fine let's just

play14:39

do this ourselves so show me simple

play14:41

python code to scrape Twitter

play14:45

for sentiment analysis

play14:47

on the NBA Warriors team just like the

play14:51

Warriors team can you do this like

play14:52

simple thing for me chat gbt like forget

play14:55

deep learning at scale with Transformers

play14:58

and reinforcement learning just okay it

play15:01

may violate the content policy but

play15:03

you're still going to give it to me

play15:05

thank you very much opening I appreciate

play15:06

that we as a community appreciate that

play15:09

all right so

play15:11

um it's giving us the use of two

play15:13

different libraries the first one is

play15:14

called Twee pi and what Twee Pi does is

play15:17

it's a python wrapper around the Twitter

play15:19

API the second one is text blob and what

play15:22

text blob does is it's not super

play15:24

Advanced machine learning what it's

play15:25

using is a lexicon and what a lexicon is

play15:28

is it's a dictionary of values that are

play15:31

correlated with different words so let's

play15:33

paste that into a Google collab and it's

play15:37

going to ask us for our consumer key our

play15:41

consumer Seeker our access token and our

play15:43

access token secret as well as what team

play15:46

we want and so in order to do that we

play15:47

have to go to the developer portal on

play15:50

Twitter and

play15:52

at the developer portal we have to

play15:54

create a new test app once we create

play15:56

that test app under settings it's going

play15:58

to give us all of the keys that we need

play16:01

for that under manage under app settings

play16:03

here are the keys and tokens and then

play16:06

we'll reveal them and insert that into

play16:07

our code once we compile this we're

play16:09

going to say well what team do we care

play16:11

about and we're going to say the

play16:12

Brooklyn Nets and already it's given us

play16:15

the list of positive tweets and negative

play16:17

tweets and we can construct a very

play16:20

simple model based on just this we can

play16:22

say if there are more positive than

play16:24

negative tweets don't make a bet else

play16:27

make the bet because the team will win

play16:29

because people really love this team

play16:31

right now you know that's one very

play16:33

simple model but let's keep improving it

play16:35

so instead of just doing this Twitter

play16:37

sentiment analysis bot let's now add

play16:41

deep learning to the mix okay so let's

play16:43

ask it that question so let's say

play16:46

um chat GPT

play16:48

uh show me a deep learning model to

play16:52

predict the winning team

play16:55

given Sports data

play16:58

just something simple like

play17:00

one sentence maybe it's going to do it

play17:02

this time I hope

play17:05

thank you okay so what it's probably

play17:06

going to do is use the Keras library to

play17:08

construct a neural network the easiest

play17:10

way to construct a neural network thanks

play17:11

Francois Chalet

play17:13

um and scikit-learn to build that model

play17:18

this is going to be a neural network

play17:19

very simple stuff watch my videos a lot

play17:22

of neural network videos and it's going

play17:24

to train it on the CSV file that doesn't

play17:26

exist we got to connect that to the

play17:27

sports data API and then we're going to

play17:30

have to go through the very tedious

play17:31

process of training this model

play17:34

on all of this Sports data and that's

play17:37

going to take some time so we're going

play17:38

to train this model we're gonna have to

play17:39

do some feature processing what are the

play17:42

features we want in the model and the

play17:43

number of wins the number of wins what

play17:45

are the statistics how much data then

play17:47

we're going to have to run this at scale

play17:49

and that's going to take some time so

play17:50

let's do that we can ask chatgpt all of

play17:53

these questions

play17:53

what features should I encode what what

play17:57

should the training testing split be is

play17:59

my model good enough here are the values

play18:01

we can give it the outputs and all this

play18:03

stuff but before we do that once again

play18:04

let's just go to GitHub and search and

play18:07

I'm just going to do a very simple

play18:09

search just three words NBA machine

play18:11

learning and let's see if it gives us

play18:13

anything and lo and behold Kyle scom has

play18:17

already made an NBA machine learning

play18:20

sports betting

play18:21

system I don't know if it's a bot

play18:24

because it's not actually making the

play18:26

bets but it is using tensorflow and XG

play18:29

boost respectively to create two

play18:32

different sets of predictions right

play18:34

it's using a neural network with

play18:35

tensorflow to predict the winning team

play18:37

and then it's also using an XG boost

play18:40

algorithm to predict the winning team

play18:41

and then you can compare both of them so

play18:43

what we can do is we can combine our we

play18:46

can combine several things we can

play18:47

combine Kyle's model here with our

play18:50

Twitter Twitter sentiment analysis model

play18:52

we can say if Kyle's model predicts a

play18:55

winning team and our Twitter sentiment

play18:57

model says that this is going to be a

play18:58

very positive sentiment winning team

play19:00

then we can bet on the winning team

play19:02

right and what we're going to do is this

play19:05

is going to give us a lot of numbers so

play19:06

we're going to summarize all those

play19:08

numbers with gpt3 Okay so let's take

play19:11

this model that Kyle has and we're going

play19:13

to run it in a Google collab so we're

play19:15

going to take this copy it so what this

play19:16

is going to do is it's going to clone

play19:18

that repository into the cloud it's

play19:20

going to install all the

play19:21

requirements.txt and it's going to take

play19:24

this pre-trained model and what Kyle did

play19:26

is he trained this model on the past

play19:29

decade of NBA games and you can see many

play19:33

many many Rose many columns what are all

play19:37

of these columns what are all of these

play19:39

acronyms I'm sure some of you sports

play19:41

fanatics know mention it in the comments

play19:43

I have no idea there's a lot of them but

play19:46

that's the model they use to train on

play19:48

all right up till today given the odds

play19:50

from uh given sports book in this case

play19:53

we're going to say FanDuel

play19:55

it's going to predict given two

play19:57

different models both the XG boost model

play19:59

and the neural network model what the

play20:01

expected value for each team is going to

play20:04

be what is the expected value it is just

play20:06

the likelihood that they're going to win

play20:07

and we can see that the expected value

play20:11

is

play20:13

going to be pretty high for the New

play20:15

Orleans Pelicans and the Golden State

play20:18

Warriors and that's according to the XG

play20:21

boost model but in the neural network

play20:23

model

play20:24

it looks it actually looks very similar

play20:26

so that's the first part then we can

play20:28

augment that with tweets then after we

play20:31

do that then we can install the openai

play20:34

library to then summarize all of that

play20:37

okay the winners are here are the teams

play20:39

and here are the losers much cleaner

play20:41

much better okay here's the last part

play20:43

how did I fit it into this web app so

play20:45

what I did was I took my react startup

play20:47

template and it's just integrated with

play20:49

Firebase and then I added decksports.io

play20:52

to that and dexport.io is a

play20:55

decentralized web3 betting service and

play20:57

it's the one that I'm using because it's

play21:00

decentralized it's uses crypto and

play21:02

anybody can do it anywhere in the world

play21:03

which is really cool and once you sign

play21:05

in and the way to sign in is using a

play21:07

wallet I've signed in with my wallet

play21:10

which is uh metamask and once we sign in

play21:14

it's going to ask what network we want

play21:15

to use I'm going to sign it and then

play21:18

it's like well what network I'm going to

play21:19

select the polygon Network and then I'm

play21:21

going to use usdt which is USD tether

play21:24

and given that I'm going to go to web3

play21:27

sports betting and I I framed it into my

play21:29

original

play21:31

web up here so I could see the results

play21:33

of my predictions as well as making bets

play21:35

and you can see here the two unsettled

play21:37

bets that I made with my wallet let's

play21:39

see if I made money or lost money

play21:43

all right it's the day after in drum

play21:45

roll please it looks like the bot made

play21:48

seven thousand dollars from two bets one

play21:51

for the Warriors and one for the Nets

play21:53

thank you AI all right thank you guys so

play21:56

much for watching

play21:57

um I want to keep making videos like

play21:59

this every single week so if you want to

play22:01

keep watching Please Subscribe that's

play22:03

what really motivates me to continually

play22:04

do this and like the video as well that

play22:06

helps promote it for now I've got to go

play22:08

find the optimal prompt so thanks for

play22:10

watching

play22:13

foreign

play22:15

[Music]

Rate This

5.0 / 5 (0 votes)

Do you need a summary in English?