Missing value for predict in Classification Learner App

4 ビュー (過去 30 日間)
Huy Cao
Huy Cao 2022 年 1 月 17 日
編集済み: Cris LaPierre 2022 年 1 月 17 日
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 件のコメント
Huy Cao
Huy Cao 2022 年 1 月 17 日
@Image AnalystYes the fine tree, I saved the trained model with the code u send me
save('trainedModel69.mat', 'trainedModel69')
and then i loaded with load('trainedModel69.mat')
Am I right?

サインインしてコメントする。

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 1 月 17 日
編集済み: Cris LaPierre 2022 年 1 月 17 日
I was able to train using trainingData and test using testingData in R2021a without getting any errors.
Can you provide more details on what your validation settings were? What did you select for predictors and response?
I selected the table trainingData,. The variables were already correctly selected for predictors and response.. I used the default validation
For test data, I selected testingData. The variables were already correctly selected for predictors and response.
  4 件のコメント
Huy Cao
Huy Cao 2022 年 1 月 17 日
Yes, this is the best answer I want to. Thank youuu

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2022 年 1 月 17 日
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)
  1 件のコメント
Huy Cao
Huy Cao 2022 年 1 月 17 日
oh okay thank you, it's works

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by