不穩定學習器適合做基分類器
什么是分類? (What is sorting?)
It means to arrange data elements in increasing or decreasing order. There are many algorithms to do so like mergesort, quicksort, counting sort etc but there are pros and cons of each algorithm.
這意味著按升序或降序排列數據元素。 這樣做有很多算法,例如mergesort,quicksort,counting sort等,但是每種算法各有利弊。
One way to judge the algorithm is the stability of sorting. Stability means that the relative position of elements remain same after sorting if an equal key element exists.
判斷算法的一種方法是排序的穩定性 。 穩定性是指如果存在相等的鍵元素,則元素的相對位置在排序后保持不變。
To demonstrate it suppose a table having name column and section column.
為了演示它,假設一個表具有名稱列和節列。
Name | Section |
---|---|
Himanshu | A |
Raju | B |
Aakash | A |
Samiksha | C |
Ayush | B |
Ravi | A |
Deeksha | B |
名稱 | 部分 |
---|---|
Himanshu | 一個 |
拉朱 | 乙 |
阿卡什 | 一個 |
Samiksha | C |
阿育 | 乙 |
拉維 | 一個 |
Deeksha | 乙 |
Consider a scenario of sorting on basis of the name of student and section also. Now the first sort according to the name of the student Table will be like:
考慮根據學生姓名和科目排序的情況。 現在,根據學生表的名稱進行的第一個排序將是:
Name | Section |
---|---|
Aakash | A |
Ayush | B |
Deeksha | B |
Himanshu | A |
Raju | B |
Ravi | A |
Samiksha | C |
名稱 | 部分 |
---|---|
阿卡什 | 一個 |
阿育 | 乙 |
Deeksha | 乙 |
Himanshu | 一個 |
拉朱 | 乙 |
拉維 | 一個 |
Samiksha | C |
Now sort according to the section, there will be two output based on the algorithm is stable or not. Due to unstable algorithm now the name has become unsorted so either it will be sorted in name order or section order.
現在根據該部分進行排序,將基于該算法是否穩定輸出兩個輸出。 由于算法不穩定,現在名稱變得無法排序,因此將按照名稱順序或節順序進行排序。
Unstable Algorithm
不穩定算法
Name | Section |
---|---|
Himanshu | A |
Aakash | A |
Ravi | A |
Raju | B |
Deeksha | B |
Ayush | B |
Samiksha | C |
名稱 | 部分 |
---|---|
Himanshu | 一個 |
阿卡什 | 一個 |
拉維 | 一個 |
拉朱 | 乙 |
Deeksha | 乙 |
阿育 | 乙 |
Samiksha | C |
Stable Algorithm
穩定算法
Name | Section |
---|---|
Aakash | A |
Himanshu | A |
Ravi | A |
Ayush | B |
Deeksha | B |
Raju | B |
Samiksha | C |
名稱 | 部分 |
---|---|
阿卡什 | 一個 |
Himanshu | 一個 |
拉維 | 一個 |
阿育 | 乙 |
Deeksha | 乙 |
拉朱 | 乙 |
Samiksha | C |
As observed with unstable sort task cannot be achieved because one sorting is disordering previous sorting that is why stable sort will be preferred in the database.
正如使用不穩定排序任務所觀察到的那樣,由于一種排序使以前的排序混亂,因此無法在數據庫中優先選擇穩定排序,因此無法實現任務。
翻譯自: https://www.includehelp.com/algorithms/stability-in-sorting.aspx
不穩定學習器適合做基分類器