How can I find the weights of the features used for classification

36 views (last 30 days)
I have 165 samples each contaaiing 40 features and I want to classifiy the samples into 5 classes based on the features. I was able to use the classification app in matlab using linear SVM classifier. However, I wonder if there is a way to find the weight assigned to each feature?

Answers (1)

bharath pro
bharath pro on 2 Jul 2020
Edited: bharath pro on 2 Jul 2020
If your using the Classifiaction learner app, then you can export the model by selecting it and clicking on the export model button on the top right (https://www.mathworks.com/help/stats/export-classification-model-for-use-with-new-data.html). You can then access the model in your workspace via the exported structure. Suppose it is called C, then C.ClassificationSVM would be your SVM model. You can access the weights using model.beta ( if it an fitcsvm object ), else you can find documentation about that particular model's weights .

Community Treasure Hunt

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

Start Hunting!