Multiclass SVM classifier
The provided MATLAB functions can be used to train and perform multiclass classification on a data set using a dendrogram-based support vector machine (D-SVM).
The two main functions are:
Train_DSVM: This is the function to be used for training
Classify_DSVM: This is the function to be used for D-SVM classification
Example: Training and classification using fisheriris data
load fisheriris
train_label={zeros(30,1),ones(30,1),2*ones(30,1)};
train_cell={meas(1:30,:),meas(51:80,:),meas(101:130,:)};
[svmstruct] = Train_DSVM(train_cell,train_label);
label=[0 1 2];
test_mat=[meas(31:40,:);meas(81:90,:);meas(131:140,:)];
[Class_test] = Classify_DSVM(test_mat,label,svmstruct);
labels=[zeros(1,10),ones(1,10),2*ones(1,10)];
[Cmat,DA]= confusion_matrix(Class_test,labels,{'A','B','C'});
引用格式
Tarek Lajnef (2024). Multiclass SVM classifier (https://www.mathworks.com/matlabcentral/fileexchange/48632-multiclass-svm-classifier), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!