arguments of the "classify" function
6 views (last 30 days)
Show older comments
Hi
I have both read the doc of "classify", and have also looked at the examples with the dataset fisheriris. However I am still not completely sure I understand the syntax of this function. For instance what is meant with the following arguments:
class = classify(sample,training,group)
What is "sample" supposed to be? I understand that "training" is a training set for the classifier, and group are the class labels, so to say. Is "sample" then the test set ("sample" would be such non-standard word for it and would not have any idea why the Matlab doc is calling it this way..)? Thank you..
0 Comments
Answers (1)
Walter Roberson
on 29 Sep 2015
classify() uses the training data and the group labels to construct a classifier. Then it puts the samples through the classifier and returns the group numbers that result. samples is not test set because test set is data of known class whose outcome is compared to the trained outcome in order to help optimize the classifier. samples is data that the classifier is to be applied to -- not training or test or validation, actual use of the classifier.
1 Comment
Ishaa Kulkarni
on 8 May 2018
I have used this function as label=classify(neuralnet,feature,group) feature is a 1D array. my neural net contains 5 classes, and 50 samples each. so, I kept group=[1 2 3 4 5]
It gives me error as: The length of GROUP must equal the number of rows in TRAINING.
what is the problem? plz help
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!