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?

回答(1 个)

Bernhard Suhm
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
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 CenterFile Exchange 中查找有关 Classification Learner App 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by