-
Notifications
You must be signed in to change notification settings - Fork 0
/
Forwarding_prime.m
108 lines (73 loc) · 2.47 KB
/
Forwarding_prime.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
function [Hardmean,Softmean]=Forwarding_prime(parameters,...
fv,clfx,y_train,oldfolder,combo1)
X_test=(parameters);
cd(oldfolder);
%%
% Answerhard=cell(2,1);
% Answersoft=cell(2,1);
for ii=1:2
% fprintf('Predicting measurement %d | %d .\n', ii,2);
folderk = fv;
switch combo1
case 1
cd(folderk)
Classifiers=load('Classifiers');
Classifiers=Classifiers.Classifiers;
Experts=load('Experts.out');
clfysses=load('clfysses');
clfysses=clfysses.clfysses;
% clfy = MinMaxScalery();
% (clfy.fit(y_train(:,ii)));
Regressors=load('Regressors');
Regressors=Regressors.Regressors;
Xtrainbig=load('Xtrainbig');
Xtrainbig=Xtrainbig.Xtrainbig;
ytrainbig=load('ytrainbig');
ytrainbig=ytrainbig.ytrainbig;
[Hardmean(:,ii),Hardvariance(:,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),Softvariance(:,ii)]=Unseen_soft_1(Regressors{ii,1},...
Classifiers{ii,1},X_test,Xtrainbig{ii,1},ytrainbig{ii,1}...
,Experts,clfysses{ii,1});
case 2
cd(folderk)
% disp('Expert=DNN, Gate=DNN')
Classifiers=load('Classifiers');
Classifiers=Classifiers.Classifiers;
Experts=load('Experts.out');
Classallsbig=load('Classallsbig');
Classallsbig=Classallsbig.Classallsbig;
clfysses=load('clfysses');
clfysses=clfysses.clfysses;
Regressors=load('Regressors');
Regressors=Regressors.Regressors;
% cd(oldfolder)
[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
cd(folderk)
Classifiers=load('Classifiers');
Classifiers=Classifiers.Classifiers;
Experts=load('Experts.out');
Classallsbig=load('Classallsbig');
Classallsbig=Classallsbig.Classallsbig;
clfysses=load('clfysses');
clfysses=clfysses.clfysses;
Regressors=load('Regressors');
Regressors=Regressors.Regressors;
% cd(oldfolder)
[Hardmean(:,ii),Hardvariance(:,ii)]=prediction_3(Regressors{ii,1}...
,str2double(predict(Classifiers{ii,1},X_test))...
,X_test,Classallsbig{ii,1},Experts,clfysses{ii,1});
[Softmean(:,ii),Softvariance(:,ii)]=Unseen_soft_3(Regressors{ii,1}...
,Classifiers{ii,1},X_test,Experts,clfysses{ii,1});
%
end
cd(oldfolder)
end
end