LibSVM High-Dimension Training Matrix

1 view (last 30 days)
Hamza
Hamza on 17 Aug 2023
Answered: Drew on 22 Aug 2023
Hello everyone, I am trying to use the svmtrain function from Libsvm for 7-class multiclass classification. I have a train matrix with about 60,000 samples and 39 features. When I execute the model = svmtrain(ClassLabel, train_matrix), MATLAB crashes. Is there any way to solve this issue or another way to apply the SVM method?
Thanks in advance!

Answers (1)

Drew
Drew on 22 Aug 2023
You indicate that you have a 7-class multiclass classification problem, and you want to use SVM classifiers, so use https://www.mathworks.com/help/stats/fitcecoc.html to train the SVM classifiers: "Mdl = fitcecoc(Tbl,ResponseVarName) returns a full, trained, multiclass, error-correcting output codes (ECOC) model using the predictors in table Tbl and the class labels in Tbl.ResponseVarName. fitcecoc uses K(K – 1)/2 binary support vector machine (SVM) models using the one-versus-one coding design, where K is the number of unique class labels (levels). Mdl is a ClassificationECOC model." There are many options in fitcecoc to control things like the coding design, the details of the binary learners, etc.
Background: svmtrain has been removed from MATLAB, it is replaced with fitcsvm for binary SVM classification: https://www.mathworks.com/help/releases/R2018b/stats/svmtrain.html. Furthermore, fitcecoc makes it convenient to train many binary classifiers (such as SVMs) to solve a multiclass classification problem, such as the one you mention.

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!