After training data How to test data in classification learner app ??
35 views (last 30 days)
I am working on GSR sensor . I trained the data using classification learner app and neural network but i m unable to test my data .please tell me the process of testing of dataset , for classification i use 4-5 classes and KNN and SVM i used lebeled data for training and unlabeled for testing. please help me
Kevin Chng on 23 Jan 2020
Hi, Nilima Gautam
In classification learner app, the app will split your data either by holdout or kfold depend on your selection. It will split your data into training dataset and validation dataset. When you are training your model in the app, it uses training dataset to train it and later uses validation dataset to test it and reflect the accuracy for you. In other word, the accuracy you got in the app is the accuracy of your model based on validation dataset. When you click on the confusionchart in the apps, you can realize the number is smaller than original dataset (because it is the validation dataset splitted out from your original dataset).
However, after you export your model to workspace as trainedModel (variable), you may predict your model with any sample
signalTemp2 = trainedModel.predictFcn(outSample);
Or before you dump your dataset into classifical learning apps, you may split your dataset out first, this dataset, some people call it as testing dataset. the function is cvpartition. The workflow should be :
c = cvpartition(dataset.label,'HoldOut',0.1); %10% use for testing data
triidx = training(c);
testingdata = dataset(~triidx,:);
training_validation_data = dataset(triidx,:);
%Use classification learning apps
%Select training_validation_data to train and validate
%Classify the testing dataset using trainedModel
signalTemp2 = trainedModel.predictFcn(testingdata);
% Perform evaluation yourself. for example,loss, accuracy, confusion matrix...