-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdev_nn_datapoint.tex
More file actions
1621 lines (1305 loc) · 64.4 KB
/
Copy pathdev_nn_datapoint.tex
File metadata and controls
1621 lines (1305 loc) · 64.4 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{tufte-handout}
\usepackage{../braph2_dev}
%\geometry{showframe} % display margins for debugging page layout
\title{Implement a New Neural Network Data Point}
\author[The BRAPH~2 Developers]{The BRAPH~2 Developers}
\begin{document}
\maketitle
\begin{abstract}
\noindent
This is the developer tutorial for implementing a new neural network data point.
In this Tutorial, you will learn how to create the generator file \fn{*.gen.m} for a new neural network data point, which can then be compiled by \code{braph2genesis}. All kinds of neural network data point are (direct or indirect) extensions of the base element \code{NNDataPoint}. Here, you will use as examples the neural network data point \code{NNDataPoint\_CON\_REG} (connectivity data for regression), \code{NNDataPoint\_CON\_CLA} (connectivity data for classification), \code{NNDataPoint\_Graph\_REG} (adjacency matrix for regression), \code{NNDataPoint\_Graph\_CLA} (adjacency matrix for classification), \code{NNDataPoint\_Measure\_REG} (graph measure for regression), and \code{NNDataPoint\_Measure\_CLA} (graph measure for classification).
\end{abstract}
\tableofcontents
\clearpage
\section{Implementation of a data point with connectivity data}
\subsection{Connectivity data point for regression (\code{NNDataPoint\_CON\_REG})}
You will start by implementing in detail \code{NNDataPoint\_CON\_REG}, which is a direct extension of \code{NNDataPoint}.
A \code{NNDataPoint\_CON\_REG} contains the input and target for neural network analysis with a subject with connectivity data (\code{SubjectCON}), where the input is the subject's connectivity data and the target are the subject's variables of interest.
\begin{lstlisting}[
label=cd:m:NNDataPoint_CON_REG:header,
caption={
{\bf NNDataPoint\_CON\_REG element header.}
The \code{header} section of the generator code in \fn{\_NNDataPoint\_CON\_REG.gen.m} provides the general information about the \code{NNDataPoint\_CON\_REG} element.
}
]
%% ¡header!
NNDataPoint_CON_REG < NNDataPoint (dp, connectivity regression data point) is a data point for regression with connectivity data.
¥\circled{1}\circlednote{1}{ defines \code{NNDataPoint\_CON\_REG} as a subclass of \code{NNDataPoint}. The moniker will be \code{dp}.}¥
%%% ¡description!
A data point for regression with connectivity data (NNDataPoint_CON_REG)
contains the input and target for neural network analysis with a subject with connectivity data (SubjectCON).
The input is the connectivity data of the subject.
The target is obtained from the variables of interest of the subject.
%%% ¡build!
1
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_CON_REG:prop_update},
caption={
{\bf NNDataPoint\_CON\_REG element props update.}
The \code{props\_update} section of the generator code in \fn{\_NNDataPoint\_CON\_REG.gen.m} updates the properties of the \code{NNDataPoint} element. This defines the core properties of the data point.
}
]
%% ¡props_update!
%%% ¡prop!
NAME (constant, string) is the name of a data point for regression with connectivity data.
%%%% ¡default!
'NNDataPoint_CON_REG'
%%% ¡prop!
DESCRIPTION (constant, string) is the description of a data point for regression with connectivity data.
%%%% ¡default!
'A data point for regression with connectivity data (NNDataPoint_CON_REG) contains the input and target for neural network analysis with a subject with connectivity data (SubjectCON). The input is the connectivity data of the subject. The target is obtained from the variables of interest of the subject.'
%%% ¡prop!
TEMPLATE (parameter, item) is the template of a data point for regression with connectivity data.
%%%% ¡settings!
'NNDataPoint_CON_REG'
%%% ¡prop!
ID (data, string) is a few-letter code for a data point for regression with connectivity data.
%%%% ¡default!
'NNDataPoint_CON_REG ID'
%%% ¡prop!
LABEL (metadata, string) is an extended label of a data point for regression with connectivity data.
%%%% ¡default!
'NNDataPoint_CON_REG label'
%%% ¡prop!
NOTES (metadata, string) are some specific notes about a data point for regression with connectivity data.
%%%% ¡default!
'NNDataPoint_CON_REG notes'
%%% ¡prop! ¥\circled{1}\circlednote{1}{ The property \code{INPUT} is the input value for this data point, which is obtained directly from the connectivity data of \code{Subject\_CON} \circled{2}.}¥
INPUT (result, cell) is the input value for this data point.
%%%% ¡calculate!
value = {dp.get('SUB').get('CON')}; ¥\circled{2}¥
%%% ¡prop! ¥\circled{3}\circlednote{3}{ The property \code{TARGET} is the target value for this data point, which is obtained directly from the variables of interest \circled{4}.}¥
TARGET (result, cell) is the target value for this data point.
%%%% ¡calculate!
value = cellfun(@(x) dp.get('SUB').get('VOI_DICT').get('IT', x).get('V'), dp.get('TARGET_IDS'), 'UniformOutput', false); ¥\circled{4}¥
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_CON_REG:props},
caption={
{\bf NNDataPoint\_CON\_REG element props.}
The \code{props} section of generator code in \fn{\_NNDataPoint\_CON\_REG.gen.m} defines the properties to be used in \fn{NNDataPoint\_CON\_REG}.
}
]
%% ¡props!
%%% ¡prop! ¥\circled{1}\circlednote{1}{ The property \code{SUB} is a subject with connectivity data (\code{Subject\_CON}), which is used to calculated the properties \code{INPUT} and \code{TARGET}.}¥
SUB (data, item) is a subject with connectivity data.
%%%% ¡settings!
'SubjectCON'
%%% ¡prop! ¥\circled{2}\circlednote{2}{ The property \code{TARGET\_IDS} defines the IDs of target, where the target IDs should be from the subject's variable-of-interest IDs.}¥
TARGET_IDS (parameter, stringlist) is a list of variable-of-interest IDs to be used as regression targets.
\end{lstlisting}
\clearpage
\begin{lstlisting}[
label=cd:m:NNDataPoint_CON_REG:tests,
caption={
{\bf NNDataPoint\_CON\_REG element tests.}
The \code{tests} section from the element generator \fn{\_NNDataPoint\_CON\_REG.gen.m}.
A test for creating example files should be prepared to test the properties of the data point. Furthermore, additional test should be prepared for validating the value of input and target for the data point.
}
]
%% ¡tests!
%%% ¡excluded_props! ¥\circled{1}\circlednote{1}{ List of properties that are excluded from testing.}¥
[NNDataPoint_CON_REG.SUB]
%%% ¡test!
%%%% ¡name!
Example ¥\circled{2}\circlednote{2}{ creates the example connectivity data files for regression analysis.}¥
%%%% ¡code!
create_data_NN_REG_CON_TXT() % only creates files if the example folder doesn't already exist
create_data_NN_REG_CON_XLS() % only creates files if the example folder doesn't already exist
%%% ¡test!
%%%% ¡name! ¥\circled{3}\circlednote{3}{ validates the data point by using assertions to confirm that the input and target calculated values match the connectivity data and the variables of interest in the example files.}¥
Create a NNDataset containg NNDataPoint_CON_REG with simulated data
%%%% ¡code!
% Load BrainAtlas
im_ba = ImporterBrainAtlasXLS( ...
'FILE', [fileparts(which('NNDataPoint_CON_REG')) filesep 'Example data NN REG CON XLS' filesep 'atlas.xlsx'], ...
'WAITBAR', true ...
);
ba = im_ba.get('BA');
% Load Group of SubjectCON
im_gr = ImporterGroupSubjectCON_XLS( ...
'DIRECTORY', [fileparts(which('NNDataPoint_CON_REG')) filesep 'Example data NN REG CON XLS' filesep 'CON_Group_XLS'], ...
'BA', ba, ...
'WAITBAR', true ...
);
gr = im_gr.get('GR');
% create an item list of NNDataPoint_CON_REG ¥\circled{4}\circlednote{4}{---\circled{6} create an item list for the data points, subsequently generates the data point dictionary using the list, and then constructs the neural network dataset containing these data points.}¥
it_list = cellfun(@(x) NNDataPoint_CON_REG( ...
'ID', x.get('ID'), ...
'SUB', x, ...
'TARGET_IDS', x.get('VOI_DICT').get('KEYS')), ...
gr.get('SUB_DICT').get('IT_LIST'), ...
'UniformOutput', false);
% create a NNDataPoint_CON_REG DICT ¥\circled{5}¥
dp_list = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_CON_REG', ...
'IT_LIST', it_list ...
);
% create a NNDataset containing the NNDataPoint_CON_REG DICT ¥\circled{6}¥
d = NNDataset( ...
'DP_CLASS', 'NNDataPoint_CON_REG', ...
'DP_DICT', dp_list ...
);
% Check whether the number of inputs matches ¥\circled{7}\circlednote{7}{ tests the number of inputs from the dataset matches the number of subjects in the group.}¥
assert(length(d.get('INPUTS')) == gr.get('SUB_DICT').get('LENGTH'), ...
[BRAPH2.STR ':NNDataPoint_CON_REG:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_REG does not construct the dataset correctly. The number of the inputs should be the same as the number of imported subjects.' ...
)
% Check whether the number of targets matches ¥\circled{8}\circlednote{8}{ tests the number of targets from the dataset matches the number of subjects in the group.}¥
assert(length(d.get('TARGETS')) == gr.get('SUB_DICT').get('LENGTH'), ...
[BRAPH2.STR ':NNDataPoint_CON_REG:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_REG does not construct the dataset correctly. The number of the targets should be the same as the number of imported subjects.' ...
)
% Check whether the content of input for a single data point matches ¥\circled{9}\circlednote{9}{ tests the value of each input from the data point matches the subject's connectivity data.}¥
for index = 1:1:gr.get('SUB_DICT').get('LENGTH')
individual_input = d.get('DP_DICT').get('IT', index).get('INPUT');
known_input = {gr.get('SUB_DICT').get('IT', index).get('CON')};
assert(isequal(individual_input, known_input), ...
[BRAPH2.STR ':NNDataPoint_CON_REG:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_REG does not construct the dataset correctly. The input value is not derived correctly.' ...
)
end
%%% ¡test!
%%%% ¡name! ¥\circled{10}\circlednote{10}{ executes the corresponding example scripts to ensure the functionalities.}¥
Example training-test regression
%%%% ¡code!
% ensure the example data is generated
if ~isfile([fileparts(which('NNDataPoint_CON_REG')) filesep 'Example data NN REG CON XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_XLS() % create example files
end
example_NN_CON_REG
\end{lstlisting}
\clearpage
\subsection{Connectivity data point for classification (\code{NNDataPoint\_CON\_CLA})}
You can now use \code{NNDataPoint\_CON\_REG} as the basis to implement the \code{NNDataPoint\_CON\_CLA}, which can be used for classification tasks.
{%TEX
The parts of the code that are modified are highlighted.
}%TEX
\begin{lstlisting}[
label=cd:m:NNDataPoint_CON_CLA:header,
caption={
{\bf NNDataPoint\_CON\_CLA element header.}
The \code{header} section of the generator code in \fn{\_NNDataPoint\_CON\_CLA.gen.m} provides the general information about the \code{NNDataPoint\_CON\_CLA} element. \expand{cd:m:NNDataPoint_CON_REG:header}
}
]
¤%% ¡header!¤
NNDataPoint_CON_CLA ¤< NNDataPoint¤ (dp, connectivity classification data point) ¤is a data point for¤ classification ¤with connectivity data¤.
¤%%% ¡description!¤
¤A data point for ¤classification¤ with connectivity data¤ (NNDataPoint_CON_CLA)
¤contains the input and target for neural network analysis with a subject with connectivity data (SubjectCON).
The input is the connectivity data of the subject.
The target is obtained from the variables of interest of the subject.
%%% ¡build!
¤1
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_CON_CLA:prop_update},
caption={
{\bf NNDataPoint\_CON\_CLA element props update.}
The \code{props\_update} section of the generator code in \fn{\_NNDataPoint\_CON\_CLA.gen.m} updates the properties of the \code{NNDataPoint\_CON\_CLA} element. This defines the core properties of the data point. \expand{cd:m:NNDataPoint_CON_REG:prop_update}
}
]
¤%% ¡props_update!¤
¤%%% ¡prop!
NAME (constant, string) is the name of a data point for ¤classification¤ with connectivity data.
%%%% ¡default!¤
'NNDataPoint_CON_CLA'
¤%%% ¡prop!
DESCRIPTION (constant, string) is the description of a data point for ¤classification¤ with connectivity data.
%%%% ¡default!¤
'A data point for classification with connectivity data (NNDataPoint_CON_CLA) contains the input and target for neural network analysis with a subject with connectivity data (SubjectCON). The input is the connectivity data of the subject. The target is obtained from the variables of interest of the subject.'
¤%%% ¡prop!
TEMPLATE (parameter, item) is the template of a data point for ¤classification¤ with connectivity data.
%%%% ¡settings!¤
'NNDataPoint_CON_CLA'
¤%%% ¡prop!
ID (data, string) is a few-letter code for a data point for ¤classification¤ with connectivity data.
%%%% ¡default!¤
'NNDataPoint_CON_CLA ID'
¤%%% ¡prop!
LABEL (metadata, string) is an extended label of a data point for ¤classification¤ with connectivity data.
%%%% ¡default!¤
'NNDataPoint_CON_CLA label'
¤%%% ¡prop!
NOTES (metadata, string) are some specific notes about a data point for ¤classification¤ with connectivity data.
%%%% ¡default!¤
'NNDataPoint_CON_CLA notes'
¤%%% ¡prop!
INPUT (result, cell) is the input value for this data point.
%%%% ¡calculate!
value = {dp.get('SUB').get('CON')};¤
%%% ¡prop! ¥\circled{1}\circlednote{1}{ defines the target value using the data point's label in the form of a string, e.g., \code{'Group1'}, contained in a cell array and representing the class of the data point.}¥
TARGET (result, cell) is the target values for this data point.
%%%% ¡calculate!
value = cellfun(@(c) sum(double(c)), dp.get('TARGET_CLASS'), 'UniformOutput', false);
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_CON_CLA:props},
caption={
{\bf NNDataPoint\_CON\_CLA element props.}
The \code{props} section of generator code in \fn{\_NNDataPoint\_CON\_CLA.gen.m} defines the properties to be used in \fn{NNDataPoint\_CON\_CLA}.
}
]
¤%% ¡props!¤
¤%%% ¡prop!
SUB (data, item) is a subject with connectivity data.
%%%% ¡settings!
'SubjectCON'¤
%%% ¡prop!
TARGET_CLASS (parameter, stringlist) is a list of variable-of-interest IDs to be used as the class targets.
\end{lstlisting}
\begin{lstlisting}[
label=cd:m:NNDataPoint_CON_CLA:tests,
caption={
{\bf NNDataPoint\_CON\_CLA element tests.}
The \code{tests} section from the element generator \fn{\_NNDataPoint\_CON\_CLA.gen.m}.
A test for creating example files should be prepared to test the properties of the data point. Furthermore, additional test should be prepared for validating the value of input and target for the data point.
}
]
¤%% ¡tests!¤
¤%%% ¡excluded_props!¤
[NNDataPoint_CON_CLA.SUB]
¤%%% ¡test!
%%%% ¡name!
Example
%%%% ¡code!¤
create_data_NN_CLA_CON_XLS() % only creates files if the example folder doesn't already exist
create_data_NN_CLA_CON_TXT() % only creates files if the example folder doesn't already exist
¤
¤%%% ¡test!
%%%% ¡name!
Create a NNDataset containg NNDataPoint_CON_CLA with simulated data
¤%%%% ¡code!
% Load BrainAtlas
im_ba = ImporterBrainAtlasXLS( ...
'FILE', [fileparts(which('NNDataPoint_CON_CLA')) filesep 'Example data NN CLA CON XLS' filesep 'atlas.xlsx'], ...
'WAITBAR', true ...
);
ba = im_ba.get('BA');¤
% Load Groups of SubjectCON ¥\circled{6}\circlednote{6}{ imports two groups of simulated data.}¥
im_gr1 = ImporterGroupSubjectCON_XLS( ...
'DIRECTORY', [fileparts(which('NNDataPoint_CON_CLA')) filesep 'Example data NN CLA CON XLS' filesep 'CON_Group_1_XLS'], ...
'BA', ba, ...
'WAITBAR', true ...
);
gr1 = im_gr1.get('GR');
im_gr2 = ImporterGroupSubjectCON_XLS( ...
'DIRECTORY', [fileparts(which('NNDataPoint_CON_CLA')) filesep 'Example data NN CLA CON XLS' filesep 'CON_Group_2_XLS'], ...
'BA', ba, ...
'WAITBAR', true ...
);
gr2 = im_gr2.get('GR');
% create item lists of NNDataPoint_CON_CLA ¥\circled{7}\circlednote{7}{ creates two datasets for the two groups.}¥
[~, group_folder_name] = fileparts(im_gr1.get('DIRECTORY'));
it_list1 = cellfun(@(x) NNDataPoint_CON_CLA( ...
'ID', x.get('ID'), ...
'SUB', x, ...
'TARGET_CLASS', {group_folder_name}), ...
gr1.get('SUB_DICT').get('IT_LIST'), ...
'UniformOutput', false);
[~, group_folder_name] = fileparts(im_gr2.get('DIRECTORY'));
it_list2 = cellfun(@(x) NNDataPoint_CON_CLA( ...
'ID', x.get('ID'), ...
'SUB', x, ...
'TARGET_CLASS', {group_folder_name}), ...
gr2.get('SUB_DICT').get('IT_LIST'), ...
'UniformOutput', false);
% create NNDataPoint_CON_CLA DICT items
dp_list1 = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_CON_CLA', ...
'IT_LIST', it_list1 ...
);
dp_list2 = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_CON_CLA', ...
'IT_LIST', it_list2 ...
);
% create a NNDataset containing the NNDataPoint_CON_CLA DICT
d1 = NNDataset( ...
'DP_CLASS', 'NNDataPoint_CON_CLA', ...
'DP_DICT', dp_list1 ...
);
d2 = NNDataset( ...
'DP_CLASS', 'NNDataPoint_CON_CLA', ...
'DP_DICT', dp_list2 ...
);
% Check whether the number of inputs matches ¥\circled{8}\circlednote{8}{ tests the number of inputs from the dataset matches the number of subjects in the group.}¥
assert(length(d1.get('INPUTS')) == gr1.get('SUB_DICT').get('LENGTH'), ...
[BRAPH2.STR ':NNDataPoint_CON_CLA:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_CLA does not construct the dataset correctly. The number of the inputs should be the same as the number of imported subjects of group 1.' ...
)
assert(length(d2.get('INPUTS')) == gr2.get('SUB_DICT').get('LENGTH'), ...
[BRAPH2.STR ':NNDataPoint_CON_CLA:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_CLA does not construct the dataset correctly. The number of the inputs should be the same as the number of imported subjects of group 2.' ...
)
% Check whether the number of targets matches ¥\circled{9}\circlednote{9}{ tests the number of targets from the dataset matches the number of subjects in the group.}¥
assert(length(d1.get('TARGETS')) == gr1.get('SUB_DICT').get('LENGTH'), ...
[BRAPH2.STR ':NNDataPoint_CON_CLA:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_CLA does not construct the dataset correctly. The number of the targets should be the same as the number of imported subjects of group 1.' ...
)
assert(length(d2.get('TARGETS')) == gr2.get('SUB_DICT').get('LENGTH'), ...
[BRAPH2.STR ':NNDataPoint_CON_CLA:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_CLA does not construct the dataset correctly. The number of the targets should be the same as the number of imported subjects of group 2.' ...
)
% Check whether the content of input for a single data point matches ¥\circled{10}\circlednote{10}{ tests the value of each input from the data point matches the subject's connectivity data.}¥
for index = 1:1:gr1.get('SUB_DICT').get('LENGTH')
individual_input = d1.get('DP_DICT').get('IT', index).get('INPUT');
known_input = {gr1.get('SUB_DICT').get('IT', index).get('CON')};
assert(isequal(individual_input, known_input), ...
[BRAPH2.STR ':NNDataPoint_CON_CLA:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_CLA does not construct the dataset correctly. The input value is not derived correctly.' ...
)
end
for index = 1:1:gr2.get('SUB_DICT').get('LENGTH')
individual_input = d2.get('DP_DICT').get('IT', index).get('INPUT');
known_input = {gr2.get('SUB_DICT').get('IT', index).get('CON')};
assert(isequal(individual_input, known_input), ...
[BRAPH2.STR ':NNDataPoint_CON_CLA:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_CON_CLA does not construct the dataset correctly. The input value is not derived correctly.' ...
)
end
¤%%% ¡test!
%%%% ¡name!
Example training-test ¤classification¤ ¥\circled{11}\circlednote{11}{ executes the corresponding example scripts to ensure the functionalities.}¥
%%%% ¡code!
% ensure the example data is generated¤
if ~isfile([fileparts(which('NNDataPoint_CON_CLA')) filesep 'Example data NN CLA CON XLS' filesep 'atlas.xlsx'])
create_data_NN_CLA_CON_XLS() % create example files
¤end¤
example_NN_CON_CLA
\end{lstlisting}
\clearpage
\section{Implementation of a data point with a graph}
\subsection{Graph data point for regression (\code{NNDataPoint\_Graph\_REG})}
Now you will implement \code{NNDataPoint\_Graph\_REG} based on previous codes \code{NNDataPoint\_CON\_REG}.
This neural network data point with graphs utilizes the adjacency matrix extracted from the derived graph of the subject.
The modified parts of the code are highlighted.
\begin{lstlisting}[
label=cd:m:NNDataPoint_Graph_REG:header,
caption={
{\bf NNDataPoint\_Graph\_REG element header.}
The \code{header} section of the generator code in \fn{\_NNDataPoint\_Graph\_REG.gen.m} provides the general information about the \code{NNDataPoint\_Graph\_REG} element.
}
]
¤%% ¡header!¤
NNDataPoint_Graph_REG ¤< NNDataPoint (dp, measure regressioni data point) is a data point for regression with¤ a graph.
¤%%% ¡description!¤
A data point for regression with a graph (NNDataPoint_Graph_REG)
contains both input and target for neural network analysis.
The input is the value of the adjacency matrix extracted from the derived graph of the subject.
The target is obtained from the variables of interest of the subject.
¤%%% ¡build!¤
1
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_Graph_REG:prop_update},
caption={
{\bf NNDataPoint\_Graph\_REG element props update.}
The \code{props\_update} section of the generator code in \fn{\_NNDataPoint\_Graph\_REG.gen.m} updates the properties of the \code{NNDataPoint\_Graph\_REG} element. This defines the core properties of the data point.
}
]
¤%% ¡props_update!¤
¤%%% ¡prop!
NAME (constant, string) is the name of a data point for regression with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_REG'
¤%%% ¡prop!
DESCRIPTION (constant, string) is the description of a data point for regression with ¤a graph¤.
%%%% ¡default!¤
'A data point for regression with a graph (NNDataPoint_Graph_REG) contains both input and target for neural network analysis. The input is the value of the adjacency matrix extracted from the derived graph of the subject. The target is obtained from the variables of interest of the subject.'
¤%%% ¡prop!
TEMPLATE (parameter, item) is the template of a data point for regression with ¤a graph¤.
%%%% ¡settings!¤
'NNDataPoint_Graph_REG'
¤%%% ¡prop!
ID (data, string) is a few-letter code for a data point for regression with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_REG ID'
¤%%% ¡prop!
LABEL (metadata, string) is an extended label of a data point for regression with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_REG label'
¤%%% ¡prop!
NOTES (metadata, string) are some specific notes about a data point for regression with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_REG notes'
¤%%% ¡prop!
INPUT (result, cell) is the input value for this data point.
%%%% ¡calculate!¤
value = dp.get('G').get('A'); ¥\circled{1}\circlednote{1}{ extracts the adjacency matrix from a \code{Graph} element as the input for this data point. Note that a \code{Graph} can be any kind of \code{Graph}, including \code{GraphWU}, \code{MultigraphBUD}, and \code{MultiplexBUT}, among others.}¥
¤%%% ¡prop!
TARGET (result, cell) is the target value for this data point.
%%%% ¡calculate!
value = cellfun(@(x) dp.get('SUB').get('VOI_DICT').get('IT', x).get('V'), dp.get('TARGET_IDS'), 'UniformOutput', false);¤
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_Graph_REG:props},
caption={
{\bf NNDataPoint\_Graph\_REG element props.}
The \code{props} section of generator code in \fn{\_NNDataPoint\_Graph\_REG.gen.m} defines the properties to be used in \fn{NNDataPoint\_Graph\_REG}.
}
]
¤%% ¡props!¤
%%% ¡prop! ¥\circled{1}\circlednote{1}{ defines the \code{Graph} element which contains its corresponding adjacency matrix.}¥
G (data, item) is a graph.
%%%% ¡settings!
'Graph'
¤%%% ¡prop!
SUB (data, item) is a subject.
%%%% ¡settings!
'Subject'¤
¤%%% ¡prop!
TARGET_IDS (parameter, stringlist) is a list of variable-of-interest IDs to be used as the class targets.¤
\end{lstlisting}
\clearpage
\begin{lstlisting}[
label=cd:m:NNDataPoint_Graph_REG:tests,
caption={
{\bf NNDataPoint\_Graph\_REG element tests.}
The \code{tests} section from the element generator \fn{\_NNDataPoint\_Graph\_REG.gen.m}.
A test for creating example files should be prepared to test the properties of the data point. Furthermore, additional test should be prepared for validating the value of input and target for the data point.
}
]
%% ¡tests!
%%% ¡excluded_props!
[NNDataPoint_Graph_REG.G NNDataPoint_Graph_REG.SUB]
%%% ¡test!
%%%% ¡name!¥\circled{1}\circlednote{1}{ tests with the \code{GraphWU} element which contains weighted undirected adjacency matrix.}¥
Construct the data point with the adjacency matrix derived from its weighted undirected graph (GraphWU)
%%%% ¡code!
¤% ensure the example data is generated
if ~isfile([fileparts(which('NNDataPoint_CON_REG')) filesep 'Example data NN REG CON XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_XLS() % create example files
end
% Load BrainAtlas
...¤
% Analysis CON WU ¥\circled{2}\circlednote{2}{ and \circled{3} create the \code{AnalyzeEnsemble\_CON\_WU} element and then memorize its graph dictionary \code{G\_DICT}.}¥
a_WU = AnalyzeEnsemble_CON_WU( ...
'GR', gr ...
);
a_WU.memorize('G_DICT'); ¥\circled{3}¥
% create item lists of NNDataPoint_Graph_REG ¥\circlednote{4}{ and \circled{5} creates the \code{NNDataPoint\_Graph\_REG} element and use the \code{Graph} from \code{G\_DICT}.}¥
it_list = cellfun(@(g, sub) ¥\circled{4}¥NNDataPoint_Graph_REG( ...
'ID', sub.get('ID'), ...
'G', g, ...
'SUB', sub, ...
'TARGET_IDS', sub.get('VOI_DICT').get('KEYS')), ...
¥\circled{5}¥a_WU.get('G_DICT').get('IT_LIST'), gr.get('SUB_DICT').get('IT_LIST'),...
'UniformOutput', false);
% create NNDataPoint_Graph_REG DICT items
dp_list = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_Graph_REG', ...
'IT_LIST', it_list ...
);
% create a NNDataset containing the NNDataPoint_Graph_REG DICT
d = NNDataset( ...
'DP_CLASS', 'NNDataPoint_Graph_REG', ...
'DP_DICT', dp_list ...
);
% Check whether the content of input for a single data point matches ¥\circled{6}\circlednote{6}{ tests whether the value of each input from the data point matches the graph's adjacency matrix.}¥
for index = 1:1:gr.get('SUB_DICT').get('LENGTH')
individual_input = d.get('DP_DICT').get('IT', index).get('INPUT');
known_input = a_WU.get('G_DICT').get('IT', index).get('A');
assert(isequal(individual_input, known_input), ...
[BRAPH2.STR ':NNDataPoint_Graph_REG:' BRAPH2.FAIL_TEST], ...
'NNDataPoint_Graph_REG does not construct the dataset correctly. The input value is not derived correctly.' ...
)
end
%%% ¡test!
%%%% ¡name!¥\circled{7}\circlednote{7}{ tests with the \code{MultigraphBUD} element which contains the adjacency matrix of binary undirected graph at fixed densities.}¥
Construct the data point with the adjacency matrix derived from its binary undirected multigraph with fixed densities (MultigraphBUD)
%%%% ¡code!
¤% ensure the example data is generated
if ~isfile([fileparts(which('NNDataPoint_CON_REG')) filesep 'Example data NN REG CON XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_XLS() % create example files
end
% Load BrainAtlas
...¤
% Analysis CON WU
densities = 0:25:100;
a_BUD = ¥\circled{8}¥AnalyzeEnsemble_CON_BUD( ...
'DENSITIES', densities, ...
'GR', gr ...
);
a_BUD.memorize('G_DICT');
% create item lists of NNDataPoint_Graph_REG¥\circlednote{8}{---\circled{10} create the \code{NNDataPoint\_Graph\_REG} element and use the \code{Graph} from \code{AnalyzeEnsemble\_CON\_BUD}.}¥
it_list = cellfun(@(g, sub) ¥\circled{9}¥ NNDataPoint_Graph_REG( ...
'ID', sub.get('ID'), ...
'G', g, ...
'SUB', sub, ...
'TARGET_IDS', sub.get('VOI_DICT').get('KEYS')), ...
¥\circled{10}¥a_BUD.get('G_DICT').get('IT_LIST'), gr.get('SUB_DICT').get('IT_LIST'),...
'UniformOutput', false);
¤% create NNDataPoint_Graph_REG DICT items
dp_list = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_Graph_REG', ...
'IT_LIST', it_list ...
);
...¤
%%% ¡test!
%%%% ¡name! ¥\circled{11}\circlednote{11}{ tests with the \code{MultiplexWU} element which contains the adjacency matrix of weighted undirected multipex.}¥
Construct the data point with the adjacency matrix derived from its multiplex weighted undirected graph (MultiplexWU)
%%%% ¡code!
¤% ensure the example data is generated
if ~isfile([fileparts(which('SubjectCON_FUN_MP')) filesep 'Example data CON_FUN_MP XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_FUN_MP_XLS() % create example files
end
% Load BrainAtlas
...¤
% Analysis CON FUN MP WU
a_WU = ¥\circled{12}¥AnalyzeEnsemble_CON_FUN_MP_WU( ...
'GR', gr ...
);
a_WU.memorize('G_DICT');
% create item lists of NNDataPoint_Graph_REG¥\circlednote{12}{---\circled{14} creates the \code{NNDataPoint\_Graph\_REG} element and use the \code{Graph} from \code{AnalyzeEnsemble\_CON\_BUD}.}¥
it_list = cellfun(@(g, sub) ¥\circled{13}¥NNDataPoint_Graph_REG( ...
'ID', sub.get('ID'), ...
'G', g, ...
'SUB', sub, ...
'TARGET_IDS', sub.get('VOI_DICT').get('KEYS')), ...
¥\circled{14}¥a_WU.get('G_DICT').get('IT_LIST'), gr.get('SUB_DICT').get('IT_LIST'),...
'UniformOutput', false);
¤% create NNDataPoint_Graph_REG DICT items
dp_list = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_Graph_REG', ...
'IT_LIST', it_list ...
);
...¤
%%% ¡test!
%%%% ¡name! ¥\circled{15}\circlednote{15}{ tests with the \code{MultigraphBUT} element with the simulated connectivity data.}¥
Example script for binary undirected graph (MultigraphBUT) using connectivity data
%%%% ¡code!
if ~isfile([fileparts(which('NNDataPoint_CON_REG')) filesep 'Example data NN REG CON XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_XLS() % create example files
end
example_NNCV_CON_BUT_REG
%%% ¡test!
%%%% ¡name! ¥\circled{16}\circlednote{16}{ tests with the \code{MultiplexBUD} element with the simulated connectivity and functional data.}¥
Example script for binary undirected multiplex at fixed densities (MultiplexBUD) using connectivity data and functional data
%%%% ¡code!
if ~isfile([fileparts(which('NNDataPoint_CON_FUN_MP_REG')) filesep 'Example data NN REG CON_FUN_MP XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_FUN_MP_XLS() % create example files
end
example_NNCV_CON_FUN_MP_BUD_REG
%%% ¡test!
%%%% ¡name! ¥\circled{17}\circlednote{17}{ tests with the \code{MultiplexBUT} element with the simulated connectivity and functional data.}¥
Example script for binary undirected multiplex at fixed thresholds (MultiplexBUT) using connectivity data and functional data
%%%% ¡code!
if ~isfile([fileparts(which('NNDataPoint_CON_FUN_MP_REG')) filesep 'Example data NN REG CON_FUN_MP XLS' filesep 'atlas.xlsx'])
create_data_NN_REG_CON_FUN_MP_XLS % create example files
end
example_NNCV_CON_FUN_MP_BUT_REG
\end{lstlisting}
\clearpage
\subsection{Graph data point for classification (\code{NNDataPoint\_Graph\_CLA})}
Now we implement \code{NNDataPoint\_Graph\_CLA} based on previous codes \code{NNDataPoint\_CON\_CLA}.
This neural network data point with graphs utilizes the adjacency matrix extracted from the derived graph of the subject.
The modified parts of the code are highlighted.
\begin{lstlisting}[
label=cd:m:NNDataPoint_Graph_CLA:header,
caption={
{\bf NNDataPoint\_Graph\_CLA element header.}
The \code{header} section of the generator code in \fn{\_NNDataPoint\_Graph\_CLA.gen.m} provides the general information about the \code{NNDataPoint\_Graph\_CLA} element.
}
]
¤%% ¡header!¤
NNDataPoint_Graph_CLA ¤< NNDataPoint¤ (dp, graph classification data point) ¤is a data point for classification with ¤a graph.
¤%%% ¡description!¤
A data point for classification with a graph (NNDataPoint_Graph_CLA)
contains both input and target for neural network analysis.
The input is the value of the adjacency matrix extracted from the derived graph of the subject.
The target is obtained from the variables of interest of the subject.
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_Graph_CLA:prop_update},
caption={
{\bf NNDataPoint\_Graph\_CLA element props update.}
The \code{props\_update} section of the generator code in \fn{\_NNDataPoint\_Graph\_CLA.gen.m} updates the properties of the \code{NNDataPoint\_Graph\_CLA} element. This defines the core properties of the data point.
}
]
¤%% ¡props_update!¤
¤%%% ¡prop!
NAME (constant, string) is the name of a data point for classification with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_CLA'
¤%%% ¡prop!
DESCRIPTION (constant, string) is the description of a data point for classification with ¤a graph¤.
%%%% ¡default!¤
'A data point for classification with a graph (NNDataPoint_Graph_CLA) contains both input and target for neural network analysis. The input is the value of the adjacency matrix extracted from the derived graph of the subject. The target is obtained from the variables of interest of the subject.'
¤%%% ¡prop!
TEMPLATE (parameter, item) is the template of a data point for classification with ¤a graph¤.
%%%% ¡settings!¤
'NNDataPoint_Graph_CLA'
¤%%% ¡prop!
ID (data, string) is a few-letter code for a data point for classification with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_CLA ID'
¤%%% ¡prop!
LABEL (metadata, string) is an extended label of a data point for classification with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_CLA label'
¤%%% ¡prop!
NOTES (metadata, string) are some specific notes about a data point for classification with ¤a graph¤.
%%%% ¡default!¤
'NNDataPoint_Graph_CLA notes'
¤%%% ¡prop!
INPUT (result, cell) is the input value for this data point.
%%%% ¡calculate!¤
value = dp.get('G').get('A'); ¥\circled{1}\circlednote{1}{ extracts the adjacency matrix from a \code{Graph} element as the input for this data point. Note that a \code{Graph} can be any kind of \code{Graph}, including \code{GraphWU}, \code{MultigraphBUD}, and \code{MultiplexBUT}, among others.}¥
¤%%% ¡prop!
TARGET (result, cell) is the target value for this data point.
%%%% ¡calculate!
value = cellfun(@(c) sum(double(c)), dp.get('TARGET_CLASS'), 'UniformOutput', false);¤
\end{lstlisting}
\begin{lstlisting}[
label={cd:m:NNDataPoint_Graph_CLA:props},
caption={
{\bf NNDataPoint\_Graph\_CLA element props.}
The \code{props} section of generator code in \fn{\_NNDataPoint\_Graph\_CLA.gen.m} defines the properties to be used in \fn{NNDataPoint\_Graph\_CLA}.
}
]
¤%% ¡props!¤
%%% ¡prop! ¥\circled{1}\circlednote{1}{ defines the \code{Graph} element which contains its corresponding adjacency matrix.}¥
G (data, item) is a graph.
%%%% ¡settings!
'Graph'
¤%%% ¡prop!
TARGET_CLASS (parameter, stringlist) is a list of variable-of-interest IDs to be used as the class targets.¤
\end{lstlisting}
\clearpage
\begin{lstlisting}[
label=cd:m:NNDataPoint_Graph_CLA:tests,
caption={
{\bf NNDataPoint\_Graph\_CLA element tests.}
The \code{tests} section from the element generator \fn{\_NNDataPoint\_Graph\_CLA.gen.m}.
A test for creating example files should be prepared to test the properties of the data point. Furthermore, additional test should be prepared for validating the value of input and target for the data point.
}
]
%% ¡tests!
%%% ¡excluded_props!
[NNDataPoint_Graph_CLA.G]
%%% ¡test!
%%%% ¡name! ¥\circled{1}\circlednote{1}{ tests with the \code{GraphWU} element which contains weighted undirected adjacency matrix.}¥
Construct the data point with the adjacency matrix derived from its weighted undirected graph (GraphWU)
%%%% ¡code!
¤% ensure the example data is generated
if ~isfile([fileparts(which('NNDataPoint_CON_CLA')) filesep 'Example data NN CLA CON XLS' filesep 'atlas.xlsx'])
create_data_NN_CLA_CON_XLS() % create example files
end
% Load BrainAtlas
...¤
% Analysis CON WU
a_WU1 = ¥\circled{2}¥AnalyzeEnsemble_CON_WU( ...
'GR', gr1 ...
);
a_WU2 = AnalyzeEnsemble_CON_WU( ...
'TEMPLATE', a_WU1, ...
'GR', gr2 ...
);
a_WU1.memorize('G_DICT');
a_WU2.memorize('G_DICT');
% create item lists of NNDataPoint_Graph_CLA ¥\circlednote{2}{---\circled{4} create \code{Analyzensemble\_CON\_WU} and use its \code{G\_DICT} to initialize \code{NNDataPoint\_Graph\_CLA}.}¥
[~, group_folder_name] = fileparts(im_gr1.get('DIRECTORY'));
it_list1 = cellfun(@(x) ¥\circled{3}¥NNDataPoint_Graph_CLA( ...
'ID', x.get('ID'), ...
'G', x, ...
'TARGET_CLASS', {group_folder_name}), ...
¥\circled{4}¥a_WU1.get('G_DICT').get('IT_LIST'), ...
'UniformOutput', false);
[~, group_folder_name] = fileparts(im_gr2.get('DIRECTORY'));
it_list2 = cellfun(@(x) NNDataPoint_Graph_CLA( ...
'ID', x.get('ID'), ...
'G', x, ...
'TARGET_CLASS', {group_folder_name}), ...
a_WU2.get('G_DICT').get('IT_LIST'), ...
'UniformOutput', false);
¤% create NNDataPoint_Graph_CLA DICT items
...¤
%%% ¡test!
%%%% ¡name! ¥\circled{5}\circlednote{5}{ tests with the \code{MultigraphBUD} element which contains binary undirected adjacency matrix at fixed densities.}¥
Construct the data point with the adjacency matrix derived from its binary undirected multigraph with fixed densities (MultigraphBUD)
%%%% ¡code!
¤% ensure the example data is generated
if ~isfile([fileparts(which('NNDataPoint_CON_CLA')) filesep 'Example data NN CLA CON XLS' filesep 'atlas.xlsx'])
create_data_NN_CLA_CON_XLS() % create example files
end
% Load BrainAtlas
...¤
% Analysis CON WU
densities = 0:25:100;
a_BUD1 = ¥\circled{6}¥AnalyzeEnsemble_CON_BUD( ...
'DENSITIES', densities, ...
'GR', gr1 ...
);
a_BUD2 = AnalyzeEnsemble_CON_BUD( ...
'TEMPLATE', a_BUD1, ...
'GR', gr2 ...
);
a_BUD1.memorize('G_DICT');
a_BUD2.memorize('G_DICT');
% create item lists of NNDataPoint_Graph_CLA¥\circlednote{6}{---\circled{8} create \code{Analyzensemble\_CON\_BUD} and use its \code{G\_DICT} to initialize \code{NNDataPoint\_Graph\_CLA}.}¥
[~, group_folder_name] = fileparts(im_gr1.get('DIRECTORY'));
it_list1 = cellfun(@(x) ¥\circled{7}¥NNDataPoint_Graph_CLA( ...
'ID', x.get('ID'), ...
'G', x, ...
'TARGET_CLASS', {group_folder_name}), ...
¥\circled{8}¥a_BUD1.get('G_DICT').get('IT_LIST'), ...
'UniformOutput', false);
[~, group_folder_name] = fileparts(im_gr2.get('DIRECTORY'));
it_list2 = cellfun(@(x) NNDataPoint_Graph_CLA( ...
'ID', x.get('ID'), ...
'G', x, ...
'TARGET_CLASS', {group_folder_name}), ...
a_BUD2.get('G_DICT').get('IT_LIST'), ...
'UniformOutput', false);
% create NNDataPoint_Graph_CLA DICT items
dp_list1 = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_Graph_CLA', ...
'IT_LIST', it_list1 ...
);
dp_list2 = IndexedDictionary(...
'IT_CLASS', 'NNDataPoint_Graph_CLA', ...
'IT_LIST', it_list2 ...
);
¤% create a NNDataset containing the NNDataPoint_Graph_CLA DICT
...¤
%%% ¡test!
%%%% ¡name! ¥\circled{9}\circlednote{9}{ tests with the \code{MultiplexWU} element which contains weighted undirected adjacency matrix from multiplex graph.}¥
Construct the data point with the adjacency matrix derived from its multiplex weighted undirected graph (MultiplexWU)
%%%% ¡code!
¤% ensure the example data is generated
if ~isfile([fileparts(which('SubjectCON_FUN_MP')) filesep 'Example data CON_FUN_MP XLS' filesep 'atlas.xlsx'])
create_data_NN_CLA_CON_FUN_MP_XLS() % create example files
end
% Load BrainAtlas
...¤
% Analysis CON FUN MP WU
a_WU1 = ¥\circled{10}¥AnalyzeEnsemble_CON_FUN_MP_WU( ...
'GR', gr1 ...
);
a_WU2 = AnalyzeEnsemble_CON_FUN_MP_WU( ...
'TEMPLATE', a_WU1, ...
'GR', gr2 ...
);
a_WU1.memorize('G_DICT');
a_WU2.memorize('G_DICT');
% create item lists of NNDataPoint_Graph_CLA ¥\circlednote{10}{---\circled{12} create \code{Analyzensemble\_CON\_FUN\_MP\_WU} and use its \code{G\_DICT} to initialize \code{NNDataPoint\_Graph\_CLA}.}¥
[~, group_folder_name] = fileparts(im_gr1.get('DIRECTORY'));
it_list1 = cellfun(@(x) ¥\circled{11}¥NNDataPoint_Graph_CLA( ...
'ID', x.get('ID'), ...
'G', x, ...
'TARGET_CLASS', {group_folder_name}), ...
¥\circled{12}¥a_WU1.get('G_DICT').get('IT_LIST'), ...
'UniformOutput', false);
[~, group_folder_name] = fileparts(im_gr2.get('DIRECTORY'));
it_list2 = cellfun(@(x) NNDataPoint_Graph_CLA( ...
'ID', x.get('ID'), ...
'G', x, ...
'TARGET_CLASS', {group_folder_name}), ...
a_WU2.get('G_DICT').get('IT_LIST'), ...
'UniformOutput', false);
¤% create NNDataPoint_Graph_CLA DICT items