SVM: Classify using LearnerWeights

I used fitcecoc to train a multiclass svm algorithm on MATLAB, the resulting struct has all the weights and the bias. Which formula should I use to classify a new data x without using predict? I've tried this one: f=x'*weight+bias but it doesn't work. Please help! Thank you!!

1 comentario

Johanna Richter
Johanna Richter el 19 de Oct. de 2020
Editada: Johanna Richter el 19 de Oct. de 2020
fitcecoc trains several binary models which you can get seperately with Mdl.BinaryLearners. They each contain weight and bias for one binary learner. You can check which binary learner put which classes of data into one class for learning by checking Mdl.CodingMatrix.
Check the MATLAB documentiation for the object -CompactClassificationECOC-. This is the object your model is when learned with fitcecoc (when trained with the corresponding options, but the other ones are not very different regarding the return values). There you can read all about how your model is constructed.
There is a reason there is the function predict. A multiclass modell is complicated, especially if you don't use onevsone, or expand to kernel functions and other options!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Networks en Centro de ayuda y File Exchange.

Preguntada:

el 26 de Mzo. de 2017

Editada:

el 19 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by