初級 美國腔 112 分類 收藏
開始影片後,點擊或框選字幕可以立即查詢單字
字庫載入中…
回報字幕錯誤
Hello My name is Thales Sehn Körting and I will
present very breafly how the kNN algorithm works
kNN means k nearest neighbors It's a very simple algorithm, and given N
training vectors, suppose we have all these 'a' and 'o' letters as training vectors in
this bidimensional feature space, the kNN algorithm identifies the k nearest neighbors
of 'c' 'c' is another feature vector that we want
to estimate its class In this case it identifies the nearest neighbors
regardless of labels So, suppose this example we have k equal to
3, and we have the classes 'a' and 'o' And the aim of the algorithm is to find the
class for 'c' If k is 3 we have to find the 3 nearest neighbors
of 'c' So, we can see that in this case the 3 nearest
neighbors of 'c' are these 3 elements here We have 1 nearest neighbor of class 'a', we
have 2 elements of the class 'o' which are near to 'c'
We have 2 votes for 'o' and 1 vote for 'a' In this case, the class of the element 'c'
is going to be 'o' This is very simple how the algorithm k nearest
neighbors works Now, this is a special case of the kNN algorithm,
is that when k is equal to 1 So, we must try to find the nearest neighbor
of the element that will define the class And to represent this feature space, each
training vector will define a region in this feature space here
And a property that we have is that each region is defined by this equation
We have a distance between each element x and x_i, that have to be smaller than the
same distance for each other element In this case it will define a Voronoi partition
of the space, and can be defined, for example, this element 'c' and these elements 'b', 'e'
and 'a' will define these regions, very specific regions
This is a property of the kNN algorithm when k is equal to 1
We define regions 1, 2, 3 and 4, based on the nearest neighbor rule
Each element that is inside this area will be classified as 'a', as well as each element
inside this area will be classified as 'c' And the same for the region 2 and region 3,
for classes 'e' and 'b' as well Now I have just some remarks about the kNN
We have to chose and odd value of k if you have a 2-class problem
This happens because when we have a 2-class and if we set k equal to 2, for example, we
can have a tie What will be the class? The majority class
inside the nearest neighbors? So, we have always to set odd values for a
2-class problem And also the value of k must not be a multiple
of the number of classes, it is also to avoid ties
And we have to remember that the main drawback of this algorithm is the complexity in searching
the nearest neighbors for each sample The complexity is a problem because we have
lots of elements, in the case of a big dataset we will have lots of elements
And we will have to search the distance between each element to the element that we want to
classify So, for a large dataset, this can be a problem
Anyhow, this kNN algorithm produces good results So, this is the reference I have used to prepare
this presentation Thanks for your attention, and this is very
breafly how the kNN algorithm works
提示:點選文章或是影片下面的字幕單字,可以直接快速翻譯喔!

載入中…

KNN如何工作 (How kNN algorithm works)

112 分類 收藏
Jarne 發佈於 2019 年 11 月 19 日
看更多推薦影片
  1. 1. 單字查詢

    在字幕上選取單字即可即時查詢單字喔!

  2. 2. 單句重複播放

    可重複聽取一句單句,加強聽力!

  3. 3. 使用快速鍵

    使用影片快速鍵,讓學習更有效率!

  4. 4. 關閉語言字幕

    進階版練習可關閉字幕純聽英文哦!

  5. 5. 內嵌播放器

    可以將英文字幕學習播放器內嵌到部落格等地方喔

  6. 6. 展開播放器

    可隱藏右方全文及字典欄位,觀看影片更舒適!

  1. 英文聽力測驗

    挑戰字幕英文聽力測驗!

  1. 點擊展開筆記本讓你看的更舒服

  1. UrbanDictionary 俚語字典整合查詢。一般字典查詢不到你滿意的解譯,不妨使用「俚語字典」,或許會讓你有滿意的答案喔