Missing value for predict in Classification Learner App
Show older comments
Hi, I have a question. I did the Classification Step with the training step. After trainning I use test data in the App, I have added the data data into Data Test set, but there is one error it said Missing value for predict Power. Can anyone help me, cause I think my data is not missing anything
% TRAINING
trainingData=readtable("ClassificationData2.xlsx")
% The first 4 columns are the inputs.
tPredictors = trainingData(:, 1:2);
% The last column is the "answer/ground truth".
tResponse = trainingData{:, end};
testingData=readtable("ClassificationTestData2.xlsx")
tTesting=testingData(:,1:2);
ttestResponse=testingData{:,end};
T=readtable('ClassificationTestData3.xlsx')
[a,b,c]=xlsread('ClassificationTestData3');
save ClassificationTestData3 c

2 Comments
Image Analyst
on 17 Jan 2022
What model did you use? Fine Tree? Did you export trainedModel to trainedModel.mat with the Export button and use load() to read it back in and then use predict on your test data? Please attach trainedModel.mat with the paperclip icon.
Huy Cao
on 17 Jan 2022
Accepted Answer
More Answers (1)
Image Analyst
on 17 Jan 2022
In code you can do this:
% Load saved model.
s = load('trainedModel69.mat')
trainedModel69 = s.trainedModel69
% Read in test table with columns for power and WingSpeed.
tPredictors = readtable('ClassificationTestData3.xlsx')
% Get estimated output values based on these input values.
predictedValues = trainedModel69.predictFcn(tPredictors)
Categories
Find more on Classification Learner App in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



