not getting same accuracy as classifier app
조회 수: 2 (최근 30일)
이전 댓글 표시
I train a classifier, say SVM, with data standardization & 50 fold cross validation in Classifier App GUI. I get an accuracy of 90%. Now I export the model, and run prediction on the same features that was used to train the model. The result is that I get very low accuracy (~40-50%). Shouldn't I be getting high accuracy since I'm testing my train set? Is it got something to do with standardizing the test data? or does 'm.predictFcn()' take care of standardizing test data?
댓글 수: 0
답변 (1개)
Bernhard Suhm
2018년 6월 12일
The model trained inside the Learner app doesn't exactly match the exported model because the latter will be trained on the complete data set, with no evaluation data held out. But that should rather increase than decrease accuracy. You do need to ensure you have applied the same "standardization" (I assume you mean something like subtracting the mean and dividing by the standard deviation) that was applied to the "training" data, the predict function doesn't "automagically" perform such normalization, and a mismatch in that would explain the low accuracy.
댓글 수: 1
Bernhard Suhm
2018년 6월 12일
I obtained some additional clarification: you must have checked "Standardize data" among the Advanced options in the Classification Learner. That does perform the standard normalization I referred to above. And the exported model does carry the mean and standardization (in m.ClassificationSVM.Mu and *.Sigma), and the predictFcn will apply that normalization to whatever table you pass into it. I just verified that yields an accuracy slightly higher than the one reported in the app on the training set, just like I expected. So you must have got something else messed up.
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Learner App에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!