matrix 1x3 as input for testing data after train the model in classification learner
이전 댓글 표시
I have done with classification learner for training algorithm, i have explor to model to workspace for testing the data, my input data in classification learner are import from excel (table) but for testing i want to use user input, i come out with this code. (one more thing if i import data from excel file, the testing data can classifiy but i dont want this way)
H2_percentage=15.217
CH4_percentage=53.261
C2H6_percentage= 31.522
testing=[H2_percentage CH4_percentage C2H6_percentage];
yfit = FineKNN.predictFcn('testing');
but when i run that code come out with this error....

답변 (1개)
Hiro Yoshino
2020년 12월 10일
yfit = FineKNN.predictFcn(testing);
You should use this instead.
댓글 수: 7
Hussein Hasan Mohsen
2020년 12월 10일
편집: Hussein Hasan Mohsen
2020년 12월 10일
Hiro Yoshino
2020년 12월 10일
It would work as long as the input is given in the format of [number number number].
Hussein Hasan Mohsen
2020년 12월 10일
Hiro Yoshino
2020년 12월 10일
Why don't you write a code by yourself?
It it is hard, then
- press small triangle under the 'export' button in classification learner and choose "function" or something
- You'll get a MATLAB code to train your model and then you now know where to make a small change to use your set of variables as training/testing data.
Note that if you train your model with a table, then you need to feed your test data in the same format.
Hussein Hasan Mohsen
2020년 12월 10일
Hiro Yoshino
2020년 12월 10일
How about convert test data into the right format?
Hussein Hasan Mohsen
2020년 12월 10일
카테고리
도움말 센터 및 File Exchange에서 Classification Learner App에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!