Can i use FitPosterior for a cell?
1 view (last 30 days)
Show older comments
Hi, i am doing a projects in which i need to use fitposterior for my multiclass svm, but when i use it i get an error that says "Undefined function 'fitPosterior' for input arguments of type 'cell'", what can i do in order to solve this problem? Do i need to change my svm from a cell type to another? If so can someone tell me how to do it?
Thanks
0 Comments
Answers (1)
arushi
on 5 Sep 2024
Hi Fabrizo,
The error message you're seeing indicates that fitPosterior is being called with an input argument of type 'cell', which is not supported. fitPosterior is a MATLAB function that adjusts the posterior probabilities of a binary classifier trained using fitcsvm. It is not directly applicable to multiclass SVMs or cell arrays.
If you have a multiclass SVM model, you need to ensure that you're working with an SVM model object, not a cell array.
To convert a multiclass SVM model into individual binary SVM model objects, you would typically need to train binary classifiers separately for each class pair. However, this is not practical or necessary for most applications because fitcecoc handles the multiclass problem internally.
If you're trying to adjust posterior probabilities for a multiclass SVM model created with fitcecoc, you can't directly use fitPosterior because it's designed for binary classification. Instead, you can use the predict function, which provides the scores or posterior probabilities as part of its output.
Hope it Helps!
0 Comments
See Also
Categories
Find more on Classification Ensembles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!