Issue with predictors in Classification Learner

Hii!
I just started learning how to use the Classification learner app by following the video posted by mathworks.
https://www.youtube.com/watch?v=lbNrlwV6Lj4&t=1470s I am trying to do something similar as he does in the second example (at around 24 mins).
My objective is to teach the app two different kinds of curves (example attached)
1. random 2. refract
I followed the example's code step by step.
I created two folders with 15 samples of each and created and exported a model.
Now what I want to do is feed 17,000 images and make Matlab tell me if the image is random or refrac and if random , then remove.
but the code asks me to provide a predictor for the 17000 test data too! How do I go about it when my object itself is for matlab to tell me which predictor is suitable for the image?
clc
imset=imageSet('refracdata','recursive');
bag=bagOfFeatures(imset,'VocabularySize',200,'Pointselection','Detector');
imagefeatures=encode(bag,imset);
refracdata=array2table(imagefeatures);
refracdata.refractype=getImageLabels(imset);
testdata=imageSet('pow1_t30_0.0')
bag=bagOfFeatures(imset,'VocabularySize',200,'Pointselection','Detector');
imagefeatures_test=encode(bag,imset);
refracdata_test=array2table(imagefeatures_test);
[trainedModel,validationAccuracy]=trainClassifier(imagefeatures_test)
the error is: Function 'subsindex' is not defined for values of class 'cell'.
Error in trainClassifier (line 48) predictors = inputTable(:, predictorNames);
Error in classification (line 14) [trainedModel,validationAccuracy]=trainClassifier(imagefeatures_test)
I am sorry if this is a stupid question but I am, by no means, a coder.
Thank you so much!

Answers (0)

Asked:

on 16 Feb 2018

Community Treasure Hunt

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

Start Hunting!