How to write a fusion code

Hello, I'm getting this error message
Error in score_total (line 25) output = My_predict(mdl,mdl2,tst_dat);
Here's how I used the code:
clear all
load my_ftrs_LBP
features_LBP =[];
trn_per_paper = 1;
for i = 1:50
img = fetch7_P{i};
features = extractLBPFeatures(img);
features_LBP = [ features_LBP; features ];
end
save my_ftrs_LBP fetch7_P features_LBP all_labels_LBP
[trn_dat, trn_lbl, tst_dat, tst_lbl ] = splitTrainTest(features_LBP,all_labels_LBP,trn_per_paper);
mdl=fitcknn(trn_dat, trn_lbl);
results = predict(mdl, tst_dat);
mdl2=fitctree(trn_dat, trn_lbl);
results2 = predict(mdl2, tst_dat);
output = My_predict(mdl,mdl2,tst_dat);
[lbl,scr] = predict(mdl,tst_dat);
[lbl2,scr2] = predict(mdl2,tst_dat);
tot_scr = scr1+scr2;
[val posn] = max(tot_scr,[],2);
output = posn

3 件のコメント

Rik
Rik 2019 年 4 月 10 日
Please check if my reconstruction of your code is the same as your code.
Also, you should share the complete error message (all the red text).
Your code causes a lot of confusion and questions. Why are you clearing everything? Why aren't you loading to a struct? Why aren't there any comments explaining what is hapening?
Chidiebere Orisakwe
Chidiebere Orisakwe 2019 年 4 月 10 日
Hello the error says I need to declare my_predict() function before calling it. So I guess my question is how do I declare it?
Rik
Rik 2019 年 4 月 10 日
This doc page should help. Note that Matlab is case-sensitive, so if you have defined my_predict(), but not My_predict() this error will still occur.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

質問済み:

2019 年 4 月 10 日

コメント済み:

Rik
2019 年 4 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by