<source : unsplash>

一、前言

檢視自己的學習成效,最好的方式就是自我測驗。在學完SVM後,你可能也會和我一樣好奇,對於SVM的知識到底掌握多少呢?

因此,接下來的文章將會引用<25 Questions to test a Data Scientist on Support Vector Machines>文章中的題目,檢測我對於SVM的了解程度,同時也紀錄各題目的知識筆記。歡迎你一起來檢測自己對SVM了解的程度。


二、題目說明與解析

Question16 - 18.

Suppose you have trained an SVM with linear decision boundary after training SVM, you correctly infer that your SVM model is under fitting.

16) Which of the following option would you more likely to consider iterating SVM next time?

A) You want to increase your data points
B) You want to decrease your data points
C) You will try to calculate more variables
D) You will try to reduce the features

解答:

C

說明:

要解決 underfitting (欠擬合)問題,最好的方法就是增加模型的複雜度,也就是選取更多的特徵。


17) Suppose you gave the correct answer in previous question. What do you think that is actually happening?

1. We are lowering the bias
2. We are lowering the variance
3. We are increasing the bias
4. We are increasing the variance

A) 1 and 2
B) 2 and 3
C) 1 and 4
D) 2 and 4


解答:

C

說明:

當模型複雜度增加時,我們會降低 Bias (偏差),但同時 Variance (變異數)會增加。

通常誤差來自  Bias(偏差) + Variance(變異數)。

當模型越簡單,對數據的學習(擬合)能力越弱,Bias(偏差) 越大,而 Variance (變異數)越小,容易發生 Underfitting 的現象。

當模型越複雜,對數據的學習(擬合)能力越強,Bias(偏差) 越小,而 Variance (變異數)越大,容易發生 Overfitting 的現象。

所以透過不同方法在Bias 和 Variance 中取得平衡,是我們一直要努力的方向,這也是機器學習的迷人之處。


18) In above question suppose you want to change one of it’s(SVM) hyperparameter so that effect would be same as previous questions i.e model will not under fit?

A) We will increase the parameter C
B) We will decrease the parameter C
C) Changing in C don’t effect
D) None of these


解答:

A

說明:

當C越大,對應越大的錯誤分類懲罰,邊界寬度越小,越容易將數據完美分類。

<source : Support Vector Machine Errors>


Question19.

19) We usually use feature normalization before using the Gaussian kernel in SVM. What is true about feature normalization?

1. We do feature normalization so that new feature will dominate other
2. Some times, feature normalization is not feasible in case of categorical variables
3. Feature normalization always helps when we use Gaussian kernel in SVM

A) 1
B) 1 and 2
C) 1 and 3
D) 2 and 3


解答:

B

說明:

對特徵做正規化後,新的特徵將主導輸出結果。

正規化不適用於類別特徵。

這2個敘述是正確的。


Question20-22.

Suppose you are dealing with 4 class classification problem and you want to train a SVM model on the data for that you are using One-vs-all method. Now answer the below questions?

20) How many times we need to train our SVM model in such case?

A) 1
B) 2
C) 3
D) 4


解答:

D

說明:

在多分類問題中,One-vs-all要求為每一個類別建立唯一的分類器,屬於此類別的所有樣本均為正類別,其餘全部為負類別。因此要得到4個類別分類,使用 SVM 就要訓練 4 次。


21) Suppose you have same distribution of classes in the data. Now, say for training 1 time in one vs all setting the SVM is taking 10 second. How many seconds would it require to train one-vs-all method end to end?

A) 20
B) 40
C) 60
D) 80


解答:

B

說明:

10(秒)×4(次) = 40(秒)


Question22.

22) Suppose your problem has changed now. Now, data has only 2 classes. What would you think how many times we need to train SVM in such case?

A) 1
B) 2
C) 3
D) 4


解答:

A

說明:

在此情況下,訓練1次SVM即可得到滿意的結果。


Question23-24.

Suppose you are using SVM with linear kernel of polynomial degree 2, Now think that you have applied this on data and found that it perfectly fit the data that means, Training and testing accuracy is 100%.

23) Now, think that you increase the complexity(or degree of polynomial of this kernel). What would you think will happen?

A) Increasing the complexity will overfit the data
B) Increasing the complexity will underfit the data
C) Nothing will happen since your model was already 100% accurate
D) None of these


解答:

A

說明:

增加模型複雜度將增加 Overfitting 的機率。


24) In the previous question after increasing the complexity you found that training accuracy was still 100%. According to you what is the reason behind that?

1. Since data is fixed and we are fitting more polynomial term or parameters so the algorithm starts memorizing everything in the data
2. Since data is fixed and SVM doesn’t need to search in big hypothesis space

A) 1
B) 2
C) 1 and 2
D) None of these


解答:

C

說明:

資料是固定的,所以當不斷擬合更多的多項式或參數,會導致模型開始記憶資料中的所有內容。

由於資料是固定的,SVM不需要在很大的假設空間中搜索。

這兩個陳述都是正確的。


Question25.

25) What is/are true about kernel in SVM?

1. Kernel function map low dimensional data to high dimensional space
2. It’s a similarity function

A) 1
B) 2
C) 1 and 2
D) None of these


解答:

C

說明:

核函數將低維空間中的資料映射到高維空間。

核函數是一個相似度函數。

這2陳述都是正確的。


恭喜你成功完成這25道題目,相信你對SVM有更多掌握。踏上Machine Learning的學習之路,繼續茁壯成長。

上一篇:考驗你對 SVM (支持向量機) 了解多少呢?試試看這25道題吧!(上)

---

參考資料:

0 留言