-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsp2lTOee.m
More file actions
137 lines (128 loc) · 6.45 KB
/
sp2lTOee.m
File metadata and controls
137 lines (128 loc) · 6.45 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
function sp2lTOee(P,Def_Base,Results)
%% exports a table of all subnets for a given partitioning for use in GEE
tabledata = [];
if ( strcmp(P,'') )
for ivar=1:length(Def_Base.Var_out)
NET = Results.(Def_Base.Algorithm_Name).(Def_Base.Validation_Dir).(Def_Base.Var_out{ivar}).NET;
netdata = [0 0 ivar 0 1];
xmin = NET.inputs{1,1}.processSettings{1,1}.xmin;
xmax = NET.inputs{1,1}.processSettings{1,1}.xmax;
ymin = NET.inputs{1,1}.processSettings{1,1}.ymin;
ymax = NET.inputs{1,1}.processSettings{1,1}.ymax;
inpslope = (ymax - ymin)./(xmax-xmin);
netdata = [netdata numel(inpslope)];
netdata = [netdata reshape(inpslope,1,numel(inpslope))];
inpoffset = (ymin-inpslope.*xmin - ymin)+ymin;
netdata = [netdata numel(inpoffset)];
netdata = [netdata reshape(inpoffset,1,numel(inpoffset))];
h1wt = NET.IW{1,1};
netdata = [netdata numel(h1wt)];
netdata = [netdata reshape(h1wt,1,numel(h1wt))];
h1bi = NET.b{1,1};
netdata = [netdata numel(h1bi)];
netdata = [netdata reshape(h1bi,1,numel(h1bi))];
h2wt = NET.LW{2,1};
netdata = [netdata numel(h2wt)];
netdata = [netdata reshape(h2wt,1,numel(h2wt))];
h2bi = NET.b{2,1};
netdata = [netdata numel(h2bi)];
netdata = [netdata reshape(h2bi,1,numel(h2bi))];
xmin = NET.outputs{3}.processSettings{1,1}.xmin;
xmax = NET.outputs{3}.processSettings{1,1}.xmax;
ymin = NET.outputs{3}.processSettings{1,1}.ymin;
ymax = NET.outputs{3}.processSettings{1,1}.ymax;
outslope = (ymax - ymin)./(xmax-xmin)+ymin;
netdata = [netdata numel(outslope)];
netdata = [netdata reshape(outslope,1,numel(outslope))];
outoffset = (ymin-outslope.*xmin - ymin);
netdata = [netdata numel(outoffset)];
netdata = [netdata reshape(outoffset,1,numel(outoffset))];
tabledata = [tabledata ; netdata];
end
export(mat2dataset(tabledata),'File',[Def_Base.Name '_' Def_Base.Algorithm_Name '_' P '_0_1.csv'],'Delimiter',',')
elseif ( strcmp(P,'Single') )
for ivar=1:length(Def_Base.Var_out)
NET = Results.(Def_Base.Algorithm_Name).(P).(Def_Base.Var_out{ivar}).NET;
netdata = [0 0 ivar 0 1];
xmin = NET.inputs{1,1}.processSettings{1,1}.xmin;
xmax = NET.inputs{1,1}.processSettings{1,1}.xmax;
ymin = NET.inputs{1,1}.processSettings{1,1}.ymin;
ymax = NET.inputs{1,1}.processSettings{1,1}.ymax;
inpslope = (ymax - ymin)./(xmax-xmin);
netdata = [netdata numel(inpslope)];
netdata = [netdata reshape(inpslope,1,numel(inpslope))];
inpoffset = (ymin-(inpslope.*xmin));
netdata = [netdata numel(inpoffset)];
netdata = [netdata reshape(inpoffset,1,numel(inpoffset))];
h1wt = NET.IW{1,1}.';
netdata = [netdata numel(h1wt)];
netdata = [netdata reshape(h1wt,1,numel(h1wt))];
h1bi = NET.b{1,1};
netdata = [netdata numel(h1bi)];
netdata = [netdata reshape(h1bi,1,numel(h1bi))];
h2wt = NET.LW{2,1};
netdata = [netdata numel(h2wt)];
netdata = [netdata reshape(h2wt,1,numel(h2wt))];
h2bi = NET.b{2,1};
netdata = [netdata numel(h2bi)];
netdata = [netdata reshape(h2bi,1,numel(h2bi))];
xmin = NET.outputs{2}.processSettings{1,1}.xmin;
xmax = NET.outputs{2}.processSettings{1,1}.xmax;
ymin = NET.outputs{2}.processSettings{1,1}.ymin;
ymax = NET.outputs{2}.processSettings{1,1}.ymax;
outslope = (ymax - ymin)./(xmax-xmin);
netdata = [netdata numel(outslope)];
netdata = [netdata reshape(outslope,1,numel(outslope))];
outoffset = (ymin-(outslope.*xmin));
netdata = [netdata numel(outoffset)];
netdata = [netdata reshape(outoffset,1,numel(outoffset))];
tabledata = [tabledata ; netdata];
end
export(mat2dataset(tabledata),'File',[Def_Base.Name '_' Def_Base.Algorithm_Name '_' P '_0_1.csv'],'Delimiter',',')
else
%% multiple partitions for each variable
for ivar=1:length(Def_Base.Var_out)
NETS = Results.(Def_Base.Algorithm_Name).(P).(Def_Base.Var_out{ivar}).NETS;
PLIST = [Results.(Def_Base.Algorithm_Name).Plist 1];
numnets = length(NETS);
for n = 1:numnets
NET = NETS(n).NET ;
netdata = [0 0 ivar PLIST(n) PLIST(n+1) ];
xmin = NET.inputs{1,1}.processSettings{1,1}.xmin;
xmax = NET.inputs{1,1}.processSettings{1,1}.xmax;
ymin = NET.inputs{1,1}.processSettings{1,1}.ymin;
ymax = NET.inputs{1,1}.processSettings{1,1}.ymax;
inpslope = (ymax - ymin)./(xmax-xmin);
netdata = [netdata numel(inpslope)];
netdata = [netdata reshape(inpslope,1,numel(inpslope))];
inpoffset = (ymin-inpslope.*xmin - ymin)+ymin;
netdata = [netdata numel(inpoffset)];
netdata = [netdata reshape(inpoffset,1,numel(inpoffset))];
h1wt = NET.IW{1,1};
netdata = [netdata numel(h1wt)];
netdata = [netdata reshape(h1wt,1,numel(h1wt))];
h1bi = NET.b{1,1};
netdata = [netdata numel(h1bi)];
netdata = [netdata reshape(h1bi,1,numel(h1bi))];
h2wt = NET.LW{2,1};
netdata = [netdata numel(h2wt)];
netdata = [netdata reshape(h2wt,1,numel(h2wt))];
h2bi = NET.b{2,1};
netdata = [netdata numel(h2bi)];
netdata = [netdata reshape(h2bi,1,numel(h2bi))];
xmin = NET.outputs{3}.processSettings{1,1}.xmin;
xmax = NET.outputs{3}.processSettings{1,1}.xmax;
ymin = NET.outputs{3}.processSettings{1,1}.ymin;
ymax = NET.outputs{3}.processSettings{1,1}.ymax;
outslope = (ymax - ymin)./(xmax-xmin);
netdata = [netdata numel(outslope)];
netdata = [netdata reshape(outslope,1,numel(outslope))];
outoffset = (ymin-outslope.*xmin - ymin)+ymin;
netdata = [netdata numel(outoffset)];
netdata = [netdata reshape(outoffset,1,numel(outoffset))];
tabledata = [tabledata ; netdata];
export(mat2dataset(tabledata),'File',[Def_Base.Name '_' Def_Base.Algorithm_Name '_' P '_' num2str(PLIST(n)) '_' num2str(PLIST(n+1)) '.csv'],'Delimiter',',')
end
end
end
return