Obtain Label predictions - Classification Learner App

Goal: With 10-fold cross-validation classify the data with a classifier (say Quadratic SVM) and then obtain the predictions
Background: Each patient (in total 14 patients) has 16 segments of EEG data, each segment is divided into 16 blocks. If more than 50% of the blocks of the segment classified as A, then corresponding segment is stated as A , for this purpose I need to be obtaining the predictions
Data Description: Contains some features extracted from each block. 14 patients*16 segments* 16 blocks*1 feature value for each block = 3534 values
The data was given to the Classification Learner App. With 10-fold cross-validation, Quadratic SVM classifier was used. It was then imported to the workspace and the following code was used to obtain the predictions.
Considering that this code is originally used for testing the testing dataset and my input to the Classification Learner app and as well as to the following code is same, is this a right way to obtain predictions for my work?
predictions = char(trainedModel.predictFcn(data));
iscorrect = predictions == cell2mat(string((data.label)));
accuracy = sum(iscorrect)*100/3584;

Answers (0)

Asked:

on 3 Feb 2022

Community Treasure Hunt

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

Start Hunting!