在這裏,我發佈兩個數字以及與他們一些問題,誰能幫我解決它們,因爲我真的陷入了它?使用libsvm瞭解SVM問題
1. Training a simple linear SVM:
% svm-train -t 0 -c 100 data0 data0.model
% python drawBoundary.py data0
where:
-t 0 -- use a linear kernel
-c 100 -- set "C" = 100, which means "overfit a lot"
於是,就有了所得情節: enter image description here
這是一種易於分離的數據集,這是由少數支持向量的反射。在該圖中,SV被拉大(並且在邊界上,虛線與決策邊界相距一個單位,實線)。
於是,就有了第一個問題:
Q1: You should have found that it takes 3 support vectors. Could you have fewer (eg., 2) support vectors here? And why?
我的回答是NO,3是最小的數字。但那只是我的直覺。我不知道爲什麼。有人可以向我解釋原因嗎?
2.
% svm-train -t 2 -c 100 -g 100 data0 data0.model
% python drawBoundary.py data0
where:
-t 2 means RBF and -g100 means gamma=100
A gamma of 100 means that you have to be really close to a point to have a kernel value that's non-zero.
下面是導致情節: enter image description here
那麼這裏就是第二個問題:
Q2:你爲什麼讓這些小斑點?爲了得到圍繞每個 示例的一個小決策邊界(即每個決策邊界恰好圍繞一個示例),您有多高?
對於這個問題,我完全迷了路。
非常感謝!但對於問題2,爲什麼你會得到這些小斑點?這是否意味着這些邊際線?我很困惑。 – JennyShen