- Prepare the data in the form of features as a matrix of extracted features, where each row corresponds to an image, and labels as a column vector of labels for each image.
- Split the data into training and testing sets with "cvpartition" function as it enables us to evaluate the performance of SVM model on unseen data.
- Train the SVM classifier for multi-class classification using "fitcecoc" function. If it is a binary classification problem, we can use "fitcsvm" function instead.
- Predict the labels of the testing set using the trained model using the "predict" function.
- Evaluate the performance of the SVM classifier by comparing the predicted labels with the actual labels with the help of performance metrics like accuracy and confusion matrix.
- "cvpartition" function: https://www.mathworks.com/help/stats/cvpartition.html
- "fitcecoc" function: https://www.mathworks.com/help/stats/fitcecoc.html
- "fitcsvm" function: https://www.mathworks.com/help/stats/fitcsvm.html
- "predict" function: https://www.mathworks.com/help/stats/classreg.learning.classif.compactclassificationsvm.predict.html