-
Notifications
You must be signed in to change notification settings - Fork 0
/
Optimize_clement_RF.m
56 lines (43 loc) · 1.48 KB
/
Optimize_clement_RF.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function out=Optimize_clement_RF(parameters,fv,clfx,y_train,...
oldfolder,ytrue,combo1,Regressors,Classifiers,...
Classallsbig,Experts,clfysses)
parameters=reshape(parameters,[],8);
X_test=(clfx.transform(parameters));
cd(oldfolder);
%%
for ii=1:2
switch combo1
case 1
[Hardmean(:,ii)]=prediction_1(Regressors{ii,1},...
pred_class(X_test, Classifiers{ii,1})...
,X_test,Xtrainbig{ii,1},ytrainbig{ii,1},Experts,clfysses{ii,1});
% [Softmean(:,ii),~]=Unseen_soft_1(Regressors{ii,1},...
% Classifiers{ii,1},X_test,Xtrainbig{ii,1},ytrainbig{ii,1}...
%,Experts,clfy);
case 2
[Hardmean(:,ii)]=prediction_2(Regressors{ii,1},pred_class(X_test...
, Classifiers{ii,1})...
,X_test,Classallsbig{ii,1},Experts,clfysses{ii,1});
% [Softmean(:,ii)]=Unseen_soft_2(Regressors{ii,1},...
% Classifiers{ii,1},X_test,Classallsbig{ii,1},Experts,clfysses{ii,1});
case 3
[Hardmean(:,ii)]=prediction_3(Regressors{ii,1}...
,str2double(predict(Classifiers{ii,1},X_test))...
,X_test,Classallsbig{ii,1},Experts,clfysses{ii,1});
% [Softmean(:,ii),~]=Unseen_soft_3(Regressors{ii,1}...
% ,Classifiers{ii,1},X_test,Experts,clfysses{ii,1});
%
end
cd(oldfolder)
end
% fprintf('Done measurement %d | %d .\n', ii,2);
%%
ytrue=reshape(ytrue,[],1);
Hardmean=double(reshape(Hardmean,[],1));
gg=size(ytrue,1);
% a1=((ytrue'-Hardmean').^2).^0.5;
a1=(1/(2*gg)) * sum((ytrue-Hardmean).^2);
%a1=abs((ytrue-Hardmean));
cc = sum(a1);
out=cc;
end