Get Posterior Probability for multi-class Linear SVM function from Classification Learner
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi Everyone,
I trained a multi-class model using Matlab Classification Learner App and turned it into a function. I got predicted class and fit score from the observations.
[fitClass, fitScore]= trained_model.predictFcn(observation);
I wish to get posterior probability score for each class rather than fit scores, which are always negative.
I found this documentation https://www.mathworks.com/help/stats/fitsvmposterior.html, but when I fit in my SVM model from the learner, the function fitSVMPosterior(SVMModel) gives me the error that
ScoreSVMModel = fitSVMPosterior(SVMModel)
Error: You must pass OBJ as an SVM model or a cross-validated SVM model.
My understanding is that fitSVMPosterior function belongs to another libary, which is not compatible with the model from he Learner App. I wonder if there is a method to get poserior probability for the model trianed from Classification learner App? Or should I use other methods that have posterior probability function to train my model Thank you for your hints!
댓글 수: 0
답변 (1개)
Pratyush Roy
2021년 3월 5일
Hi,
The multi-class SVM in Classification Learner uses the fitecoc method to fit multiple binary SVMs to solve a multiple class classification problem.
After obtaining the classification model using the fitecoc method, one can use the predict function to obtain the posterior probabilities.
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!