Classification accuracy change every time

2 views (last 30 days)
Ali Asghar
Ali Asghar on 5 Dec 2019
Commented: Razan Alyahya on 22 Nov 2020
Dear
I extracted feature from emg signal and when i classify it by below methods:
1-classification app: During classifcation classifier and accuracy change every time. like when i classify first time it show fine SVM give 70% accuracy and next time when I classify it then it show highest accuracy at 60% by KNN.
2- Secondly, I used nnstart app, it also show different accuracy of same data at different times.
Kindlly explain me its reason.
Thank you
  1 Comment
Razan Alyahya
Razan Alyahya on 22 Nov 2020
May you please provide me with the code for SVM classifier for EMG signals ?

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 5 Dec 2019
Classification app and the functions reached from nnstart all initialize randomly. If you need to be able to reproduce every time, then you would need to use rng() to set the same random number seed each time.
  3 Comments
Walter Roberson
Walter Roberson on 5 Dec 2019
You would type
rng(655321)
at the command line before starting the classification app. Then do one classification step. Then quit classification app and do the same rng() again and start classification app again before running the test again.
You just might be able to get away with typing the rng() command at the command line between runs in the GUI of classification app.
Generally speaking, if you need to exactly replicate runs to prove that you can exactly replicate runs, then you should probably not be using the classification app or nnstart, and should instead be using the underlying MATLAB library calls with the datastructures initialized as appropriate for your situation.
It is normal that if you fit exactly the same data twice in a row in classification app or nnstart, that you will get different results. It is designed that way.
This is inherent to how the classification tools work. The tools are not able to calculate a global "best" set of parameters: they randomize starting conditions and they calculate with those conditions, and then they randomize again and calculate again, and keep doing that for a while, looking for the best set of starting conditions.
Ali Asghar
Ali Asghar on 5 Dec 2019
Thank you for this explanation.
Can tell me more about "Underlying MATLAB library call" so I make the appropirate result that which feature and classification is good for which emg signals.

Sign in to comment.

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!