I'm looking into machine learning and am using LDA as a starting point. I'm following MatLab's own tutorial on LDA classification (Here).
They are using the fisheriris dataset which is already available in Matlab and can simply be loaded. In the tutorial they use this line for classification:
ldaClass = classify(meas(:,1:2),meas(:,1:2),species);
I know that:
classify trains a classifier based on the training data and labels (second and third argument), and applies the classifier to the test data (first argument) and ldaClass gives the classes chosen for the test data points, based on the classifier that has been trained using the training data points and labels
So the same data that was given to the classifier for training was used for testing as well?
My understanding of supervised learning is that once a system is trained with a training set then it should be tested with an unknown sample to test its prediction. And if it is given a test sample from the training set then it should be able to correctly classify it. Right?
Then how come in classify
when the same sample is used for training and testing it misclassified 20% of the labels?
Either LDA is a very poor classifier or I am not understanding the concept here completely. Help me out please.