[英]How to realize a 1 vs 1 multiclass classification using libsvm library (Matlab)?
如何使用libsvm實現一對一的多類分類? 請幫助我解決這個問題。
我還從這個答案中讀到了一種方法。全部方法使用Matlab進行交叉驗證的多類SVM的完整示例[關閉]
我的測試數據:功能和最后一列是標簽
D = [
1 1 1 1 1
1 1 1 9 1
1 1 1 1 1
11 11 11 11 2
11 11 11 11 2
11 11 11 11 2
30 30 30 30 3
30 30 30 30 3
30 30 30 30 3
60 60 60 60 4
60 60 60 60 4
60 60 60 60 4
];
我的測試數據是
inputTest = [
1 1 1 1
11 11 11 10
29 29 29 30
60 60 60 60
];
LIBSVM提供了Matlab接口。 在軟件包中,有一個很好的README
,介紹如何通過Matlab使用此接口。
用法是:
matlab> model = svmtrain(training_label_vector, training_instance_matrix [, 'libsvm_options']);
具有以下參數:
-training_label_vector:
An m by 1 vector of training labels (type must be double).
-training_instance_matrix:
An m by n matrix of m training instances with n features.
It can be dense or sparse (type must be double).
-libsvm_options:
A string of training options in the same format as that of LIBSVM.
但是,由12個示例組成的訓練數據不足以構建良好的SVM分類器。 您應該獲得有關培訓和測試過程的更多示例。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.