跟讀練習: Naive Bayes, Clearly Explained!!! - 通過影片學習英語口語
選擇練習模式
每種模式都會開啟全屏練習室。
156 句
如果句子過短或過長,請點選 Edit 進行調整。
1
I'm at home during lockdown, working on my StatQuest, yeah!
2
I'm at home during lockdown, working on my StatQuest, yeah!
3
StatQuest!
4
Hello, I'm Josh Starmer and welcome to StatQuest.
5
Today we're going to talk about Naive Bays and it's going to be clearly explained.
6
This StatQuest is sponsored by JadBio.
7
Just add data and their automatic machine learning algorithms will do the rest of the work for you.
8
For more details, follow the link in the pinned comment below.
9
Note, when most people want to learn about Naive Bayes, they want to learn about the multinomial
10
Naive Bayes classifier, and that's what we talk about in this video.
11
However, just know that there is another commonly used version of Naive Bayes called Gaussian Naive Bayes Classification,
12
and I cover that in a follow -up stat quest.
13
So check that one out when you're done with this quest.
14
Bam.
15
Now, imagine we received normal messages from friends and family.
16
And we also received spam, unwanted messages that are usually scams or unsolicited advertisements.
17
And we wanted to filter out the spam messages. So, the first thing we do is make a histogram of all the words
18
that occur in the normal messages from friends and family.
19
We can use the histogram to calculate the probabilities of seeing each word given that it was in a normal message.
20
For example, the probability we see the word deer, given that we saw it in a normal message,
21
is 8, the total number of times dear occurred in normal messages,
22
divided by 17, the total number of words in all of the normal messages.
23
And that gives us 0 .47.
24
So let's put that over the word dear so we don't forget it.
25
Likewise, the probability that we see the word friend, given that we saw it in a normal message,
26
is 5, the total number of times friend occurred in normal messages,
27
divided by 17, the total number of words in all of the normal messages.
28
And that gives us 0 .29.
29
So let's put that over the word friend so we don't forget it.
30
Likewise, the probability that we see the word lunch, given that it is in a normal message, is 0 .18.
31
And the probability that we see the word money, given that it is in a normal message, is 0 .06.
32
Now we make a histogram of all the words that occur in the spam.
33
And calculate the probability of seeing the word deer, given that we saw it in the spam.
34
And that is 2, the number of times we saw deer in the spam, divided by 7, the total number of words in the spam.
35
And that gives us 0 .29.
36
Likewise, we calculate the probability of seeing the remaining words, given that they were in the spam.
37
Bam!
38
Now, because these histograms are taking up a lot of space, let's get rid of them, but keep the probabilities.
39
Oh no!
40
It's the dreaded terminology alert!
41
Because we have calculated the probabilities of discrete, individual words, and not the probability of something continuous,
42
like weight or height, these probabilities are also called likelihoods.
43
I mention this because some tutorials say these are probabilities, and others say they are likelihoods.
44
In this case, the terms are interchangeable, so don't sweat it.
45
We'll talk more about probabilities versus likelihoods when we talk about Gaussian naive bays in the follow -up quest.
46
Now, imagine we got a new message that said,
47
Dear Friend, and we want to decide if it is a normal message or spam down.
48
We start with an initial guess about the probability that any message, regardless of what it says, is a normal message.
49
This guess can be any probability that we want, but a common guess is estimated from the training data.
50
For example, since 8 of the 12 messages are normal messages, our initial guess will be 0 .67.
51
So let's put that under the normal messages so we don't forget it.
52
Oh no!
53
It's another dreaded terminology alert!
54
The initial guess that we observe a normal message is called a prior probability.
55
Now we multiply the initial guess by the probability that the word dear occurs in a normal message,
56
and the probability that the word friend occurs in a normal message.
57
Now we just plug in the values that we worked out earlier and do the math.
58
Beep, boop, beep, boop, beep.
59
And we get 0 .09.
60
We can think of 0 .09 as the score that
61
Dear Friend gets if it is a normal message.
62
However, technically, it is proportional to the probability that the message is normal, given that it says Dear Friend.
63
So let's put that on top of the normal messages so we don't forget.
64
Now, just like we did before, we start with an initial guess about the probability that any message, regardless of what it says, is spam.
65
And just like before, the guess can be any probability we want, but a common guess is estimated from the training data.
66
And since 4 of the 12 messages are spam, our initial guess will be 0 .33.
67
So let's put that under the spam so we don't forget it.
68
Now we multiply that initial guess by the probability that the word dear occurs in spam.
69
And the probability that the word friend occurs in spam.
70
Now we just plugged in the values that we worked out earlier and do the math.
71
Bip, boop, bip, boop, bip.
72
And we get 0 .01.
73
Like before, we can think of 0 .01 as the score that
74
Dear Friend gets if it is spam.
75
However, technically, it is proportional to the probability that the message is spam given that it says Dear Friend.
76
And because the score we got for normal message, 0 .09, is greater than the score we got for spam,
77
0 .01, we will decide that
78
Dear Friend is a normal message.
79
Double bam!
80
Now, before we move on to a slightly more complex situation, let's review what we've done so far.
81
We started with histograms of all the words in the normal messages, and all of the words in the spam.
82
Then we calculated the probabilities of seeing each word, given that we saw the word in either a normal message or spam.
83
Then we made an initial guess about the probability of seeing a normal message.
84
This guess can be anything between 0 and 1, but we based ours on the classifications in the training dataset.
85
Then we made the same sort of guess about the probability of seeing spam.
86
Then we multiplied our initial guess
87
that the message was normal by the probabilities of seeing the words dear and friend given that the message was normal.
88
Then we multiplied our initial guess that the message was spam by the probabilities of seeing the words
89
Dear and Friend given that the message was spam.
90
Then we did the math and decided that
91
Dear Friend was a normal message because 0 .09 is greater than 0 .01.
92
Now that we understand the basics of how
93
Naive Bayes classification works, let's look at a slightly more complicated example.
94
This time, let's try to classify this message, lunch, money, money, money, money.
95
Note, this message contains the word money four times.
96
And since the probability of seeing the word money is much higher in spam than in normal messages,
97
then it seems reasonable to predict that this message will end up being spam.
98
So let's do the math math.
99
Calculating the score for a normal message works just like before.
100
We start with the initial guess, then we multiply it by the probability we see lunch, given that it is in a normal message,
101
and the probability we see money four times, given that it is in a normal message.
102
When we do the math, we get this tiny number.
103
However, when we do the same calculation for spam, we get zero.
104
This is because the probability we see lunch in spam is zero since it was not in the training data.
105
And when we plug in zero for the probability we see lunch given that it was in spam,
106
then it doesn't matter what value we picked for the initial guess that the message was spam,
107
and it doesn't matter what the probability is that we see money given that the message was spam.
108
because anything times zero is zero.
109
In other words, if a message contains the word lunch, it will not be classified as spam.
110
And that means we will always classify the messages with lunch in them as normal,
111
no matter how many times we see the word money. And that's a problem.
112
To work around this problem, people usually add one count, represented by a black box, to each word in the histograms.
113
The number of counts we add to each word is typically referred to with the Greek letter alpha.
114
In this case, alpha equals 1, but we could have set it to anything.
115
Anyway, now when we calculate the probabilities of observing each word, we never get zero.
116
For example, the probability of seeing lunch, given that it is in spam, is 1 divided by 7,
117
the total number of words in spam, plus 4, the extra counts that we added.
118
And that gives us 0 .09.
119
adding counts to each word does not change our initial guess that a message is normal, or the initial guess that the message is spam,
120
because adding a count to each word did not change the number of messages in the training data set that are normal,
121
or the number of messages that are spam.
122
Now when we calculate the scores for this message, we still get a small number for the normal message.
123
But now when we calculate the value for spam, we get a value greater than zero.
124
And since the value for spam is greater than the one for a normal message, we classify the message as spam.
125
Spam!
126
Now let's talk about why
127
Naive Bayes is naive.
128
The thing that makes
129
Naive Bayes so naive is that it treats all word orders the same.
130
For example, the normal message score for the phrase
131
Dear Friend is the exact same for the score for Friend Dear.
132
In other words, regardless of how the words are ordered, we get 0 .08.
133
Treating all word orders equal is very different from how you and I communicate.
134
Every language has grammar rules and common phrases, but Naive Bayes ignores all of that stuff.
135
Instead, Naive Bayes treats language like it is just a bag full of words and each message is a random handful of them.
136
Naive Bayes ignores all the rules because keeping track of every single reasonable phrase in a language would be impossible.
137
That said, even though Naive Bayes is naive, it tends to perform surprisingly well when separating normal messages from spam.
138
In machine learning lingo, we'd say that by ignoring relationships among words, Naive Bayes has high bias.
139
But, because it works well in practice, Naive Bayes has low variance.
140
Shameless Self -Promotion.
141
If you are not already familiar with the terms bias and variance, check out the quest.
142
The link is in the description below.
143
Triple spam!
144
Oh no, it's one last shameless self -promotion.
145
One awesome way to support StatQuest is to purchase the Naive Bayes StatQuest Study Guide.
146
It has everything you need to study for an exam or job interview.
147
It's eight pages of total awesomeness.
148
And while you're there, check out the other StatQuest Study Guides.
149
There's something for everyone.
150
Hooray!
151
We've made it to the end of another exciting StatQuest.
152
If you like this StatQuest and want to see more, please subscribe.
153
And if you want to support StatQuest, consider contributing to my Patreon campaign,
154
becoming a channel member, buying one or two of my original songs or a t -shirt or a hoodie, or just donate.
155
The links are in the description below.
156
Alright, until next time, Quest on!
同頻道
FOR YOU
推薦影片
本課的詞彙與口語要點
這節口語課以影片“Naive Bayes, Clearly Explained!!!”為素材。 影片中反覆出現的詞有:message, word, normal, spam, probability。 這段影片共有 156 個句子、1966 個單詞可供跟讀。 講話部分時長為 15:11。 說話人語速平穩,每分鐘約 130 個詞,很適合跟讀。 83% 的單詞屬於英語最常用的 3,000 詞,其餘的詞建議在練習前先學一下。
影片中的重點詞彙
影片中 15 個值得學習的單詞,附發音和釋義:
| 單詞 | 發音 | 釋義 |
|---|---|---|
| spam 名詞 | /spæm/ | 垃圾郵件 /垃圾郵件, 垃圾信 |
| probability 名詞 | /ˌpɹɑ.bəˈbɪl.ə.ti/ | 可能性 |
| naive 形容詞 | /naɪˈiv/ | 天真, 幼稚 |
| calculate 動詞 | /ˈkælkjʊleɪt/ | 計算 /計算, 算 |
| occur 動詞 | /əˈkɜː/ | 發生 /發生 |
| mathematics 名詞 | /mæθ(.ə)ˈmæt.ɪks/ | 數學 /數學, 算學 /算學 |
| quest 名詞 | /kwɛst/ | 探索, 尋求 /尋求 |
| divide 動詞 | /dɪˈvaɪd/ | 分, 分裂 |
| ignore 動詞 | /ɪɡˈnɔː/ | 無視 /無視, 忽略 |
| phrase 名詞 | /ˈfɹeɪ̯z/ | 短語 /短語, 片語 /片語 |
| classification 名詞 | /ˌklæsɪfɪˈkeɪʃən/ | 分類 /分類 |
| plug 名詞 | /plʌɡ/ | 插頭 /插頭 |
| deer 名詞 | /dɪɹ/ | 鹿 |
| likewise 副詞 | /ˈlaɪkˌwaɪz/ | 相似地, 類似地 /類似地 |
| likelihood 名詞 | /ˈlaɪklihʊd/ | 可能性 |
影片中出現的短語動詞
| 單詞 | 發音 | 釋義 |
|---|---|---|
| check out 動詞 | 退房 | |
| follow up 動詞 | 跟進 /跟進 | |
| work out 動詞 | /ˌwɝk ˈaʊt/ | 計算 /計算, 算出 |
| end up 動詞 | 到達 |
影片中的語法
說話人最常用的結構,並附上影片中的原話:
| 結構 | 影片中的用法 |
|---|---|
| 被動語態 be + 過去分詞 — 強調發生了什麼,而不是誰做的 | is sponsored · are also called · is estimated |
| 現在完成時 have/has + 過去分詞 — 過去發生但與現在仍有關聯的事 | have calculated · we've done · We've made |
需要注意的發音
說話人用了 18 次縮略和弱讀形式,例如 don't, I'm, doesn't。請按聽到的簡短形式來說。
- “th” 音: mathematics /mæθ(.ə)ˈmæt.ɪks/, algorithm /ˈælɡəɹɪðm̩/
- “sh” 和 “zh” 音: classification /ˌklæsɪfɪˈkeɪʃən/, promotion /pɹəˈmoʊʃn̩/, examination /ɪɡˌzæm.ɪˈneɪ.ʃən/, calculation /ˌkælkjuˈleɪʃn̩/, shameless /ˈʃeɪ̯mlɪs/
- 長單詞——注意重音位置: probability /ˌpɹɑ.bəˈbɪl.ə.ti/, mathematics /mæθ(.ə)ˈmæt.ɪks/, classification /ˌklæsɪfɪˈkeɪʃən/, technically /ˈtɛk.nɪˌkəl.i/, terminology /ˌtɝ.məˈnɑ.lə.d͡ʒi/
中文母語者容易讀錯的音:
- /v/ — 不要讀成 /w/,上齒輕觸下唇: naive /naɪˈiv/, divide /dɪˈvaɪd/, observe /əbˈzɜːv/, versus /ˈvɝsəs/, advertisement /ˈædvɚˌtaɪzmənt/
- 詞尾子音 — 要讀清楚,後面不要加母音: naive /naɪˈiv/, calculate /ˈkælkjʊleɪt/, mathematics /mæθ(.ə)ˈmæt.ɪks/, quest /kwɛst/, divide /dɪˈvaɪd/
- /r/ 和 /l/ 的區別: probability /ˌpɹɑ.bəˈbɪl.ə.ti/, regardless /ɹɪˈɡɑɹd.lɪs/, triple /ˈtɹɪp.əl/, surprisingly /səˈpɹaɪzɪŋli/, algorithm /ˈælɡəɹɪðm̩/
如何用這段影片練習
- 先完整聽一遍影片,不要開口,記下不認識的單詞。
- 用正常速度逐句跟讀,每句重複到你的節奏與說話人一致為止。
- 錄下自己的聲音並與原聲對比,特別注意 spam, probability, naive 這類單詞。
什麼是跟讀法?
跟讀法 (Shadowing) 是一種有科學依據的語言學習技巧,最初開發用於專業口譯員的培訓,並由多語言者Alexander Arguelles博士普及。這個方法簡單而強大:您在聽英語母語原聲的同時立即大聲重複——就像是一個延遲1-2秒緊跟說話者的影子。與被動聽力或語法練習不同,跟讀法強迫您的大腦和口腔肌肉同時處理並模模擬實的講話模式。研究表明它能顯著提高發音準確性,語調,節奏,連讀,聽力理解和口語流利度——使其成為雅思口語備考和真實英語交流最有效的方法之一。














