Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CD-BPR
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arthur Batel
CD-BPR
Commits
3903f0cc
Commit
3903f0cc
authored
1 year ago
by
Céline Robardet
Browse files
Options
Downloads
Patches
Plain Diff
xp
parent
47f28682
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Experiments.ipynb
+1
-33
1 addition, 33 deletions
Experiments.ipynb
with
1 addition
and
33 deletions
Experiments.ipynb
+
1
−
33
View file @
3903f0cc
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
"id": "1da92e4f",
"id": "1da92e4f",
"metadata": {},
"metadata": {},
"source": [
"source": [
"## Table 2: compute ACC, AUC and RMSE"
"## Table 2
and 3
: compute ACC, AUC and RMSE
and DOA
"
]
]
},
},
{
{
...
@@ -45,38 +45,6 @@
...
@@ -45,38 +45,6 @@
"!{cmd}"
"!{cmd}"
]
]
},
},
{
"cell_type": "markdown",
"id": "6b1c6b4d",
"metadata": {},
"source": [
"## Table 3: compute DOA"
]
},
{
"cell_type": "markdown",
"id": "b72eb27b",
"metadata": {
"ExecuteTime": {
"end_time": "2024-02-14T09:17:54.627435200Z",
"start_time": "2024-02-14T09:17:54.189951143Z"
}
},
"source": [
"import os\n",
"embDirPath = \"results/table_2/users/\"\n",
"\n",
"i = 3 # dataset index\n",
"\n",
"\n",
"print(os.getcwd())\n",
"cmd = 'python code/binary_bpr_ablation/compute_doa.py --data '+embDirPath+datasets[i]+'_0_BPR.csv' \n",
"!{cmd}\n",
"\n",
"#doa = compute_doa(path+datasets[i]+'/train_embed.csv')\n",
"#print(\"DOA:\", doa)"
]
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"id": "8d5630b5",
"id": "8d5630b5",
...
...
%% Cell type:code id:9d54cd9a tags:
%% Cell type:code id:9d54cd9a tags:
```
python
```
python
path
=
"
./
"
path
=
"
./
"
datasets
=
[
'
assist09_tkde
'
,
'
assist17_tkde
'
,
'
algebra
'
,
'
math_1
'
,
'
math_2
'
]
datasets
=
[
'
assist09_tkde
'
,
'
assist17_tkde
'
,
'
algebra
'
,
'
math_1
'
,
'
math_2
'
]
```
```
%% Cell type:markdown id:1da92e4f tags:
%% Cell type:markdown id:1da92e4f tags:
## Table 2: compute ACC, AUC and RMSE
## Table 2
and 3
: compute ACC, AUC and RMSE
and DOA
%% Cell type:code id:61c53cb1 tags:
%% Cell type:code id:61c53cb1 tags:
```
python
```
python
# can be long to compute.
# can be long to compute.
# You need to unzip data.zip and results.zip
# You need to unzip data.zip and results.zip
# All results are stored in ../../results/table_2
# All results are stored in ../../results/table_2
import
os
import
os
print
(
os
.
getcwd
())
print
(
os
.
getcwd
())
cmd
=
'
cd code/binary_bpr && python ./script.py
'
cmd
=
'
cd code/binary_bpr && python ./script.py
'
!
{
cmd
}
!
{
cmd
}
```
```
%% Cell type:markdown id:6b1c6b4d tags:
## Table 3: compute DOA
%% Cell type:markdown id:b72eb27b tags:
import os
embDirPath = "results/table_2/users/"
i = 3 # dataset index
print(os.getcwd())
cmd = 'python code/binary_bpr_ablation/compute_doa.py --data '+embDirPath+datasets[i]+'_0_BPR.csv'
!{cmd}
#doa = compute_doa(path+datasets[i]+'/train_embed.csv')
#print("DOA:", doa)
%% Cell type:markdown id:8d5630b5 tags:
%% Cell type:markdown id:8d5630b5 tags:
## Table 4: ablation
## Table 4: ablation
%% Cell type:code id:a9e32954 tags:
%% Cell type:code id:a9e32954 tags:
```
python
```
python
import
os
import
os
print
(
os
.
getcwd
())
print
(
os
.
getcwd
())
cmd
=
'
cd code/binary_bpr_ablation && python script_ablation.py
'
cmd
=
'
cd code/binary_bpr_ablation && python script_ablation.py
'
!
{
cmd
}
!
{
cmd
}
```
```
%% Cell type:markdown id:c5960372 tags:
%% Cell type:markdown id:c5960372 tags:
## Table 6
## Table 6
%% Cell type:code id:e46ff5d4 tags:
%% Cell type:code id:e46ff5d4 tags:
```
python
```
python
# pour all
# pour all
cmd
=
'
python code/nary_model/main_nary_cv.py --data
'
+
path
+
'
data/covid/initsurvey.csv
'
cmd
=
'
python code/nary_model/main_nary_cv.py --data
'
+
path
+
'
data/covid/initsurvey.csv
'
print
(
os
.
system
(
cmd
))
print
(
os
.
system
(
cmd
))
cmd
=
'
python code/nary_model/main_nary_cv.py --data
'
+
path
+
'
data/covid/psysurvey.csv
'
cmd
=
'
python code/nary_model/main_nary_cv.py --data
'
+
path
+
'
data/covid/psysurvey.csv
'
print
(
os
.
system
(
cmd
))
print
(
os
.
system
(
cmd
))
```
```
%% Cell type:markdown id:e586f5cb tags:
%% Cell type:markdown id:e586f5cb tags:
## Figure 1 and Table 7
## Figure 1 and Table 7
%% Cell type:code id:4c4b8106 tags:
%% Cell type:code id:4c4b8106 tags:
```
python
```
python
cmd
=
'
python code/unsupervised_DT/decision_tree.py --lower 0
'
cmd
=
'
python code/unsupervised_DT/decision_tree.py --lower 0
'
print
(
os
.
system
(
cmd
))
print
(
os
.
system
(
cmd
))
cmd
=
'
python code/unsupervised_DT/decision_tree.py --lower 1
'
cmd
=
'
python code/unsupervised_DT/decision_tree.py --lower 1
'
print
(
os
.
system
(
cmd
))
print
(
os
.
system
(
cmd
))
```
```
%% Cell type:markdown id:f39f6de3 tags:
%% Cell type:markdown id:f39f6de3 tags:
## Figure 2: radar plots --
## Figure 2: radar plots --
%% Cell type:code id:ceee0ec4 tags:
%% Cell type:code id:ceee0ec4 tags:
```
python
```
python
def
fromDFtoArray
(
name
,
vector
,
type_value
):
def
fromDFtoArray
(
name
,
vector
,
type_value
):
# Read dataframe and generate a matrix or
# Read dataframe and generate a matrix or
# a vector of appropriate type
# a vector of appropriate type
df
=
pd
.
read_csv
(
name
,
index_col
=
None
,
header
=
None
)
df
=
pd
.
read_csv
(
name
,
index_col
=
None
,
header
=
None
)
cols
=
df
.
columns
cols
=
df
.
columns
if
(
type_value
==
"
f
"
):
if
(
type_value
==
"
f
"
):
for
col
in
cols
:
for
col
in
cols
:
df
[
col
]
=
df
[
col
].
astype
(
float
)
df
[
col
]
=
df
[
col
].
astype
(
float
)
if
(
type_value
==
'
i
'
):
if
(
type_value
==
'
i
'
):
for
col
in
cols
:
for
col
in
cols
:
df
[
col
]
=
df
[
col
].
astype
(
int
)
df
[
col
]
=
df
[
col
].
astype
(
int
)
r
=
df
.
values
r
=
df
.
values
if
(
vector
):
if
(
vector
):
r
=
r
.
reshape
(
-
1
,)
r
=
r
.
reshape
(
-
1
,)
return
r
return
r
```
```
%% Cell type:code id:801e2ab1 tags:
%% Cell type:code id:801e2ab1 tags:
```
python
```
python
from
sklearn.preprocessing
import
MinMaxScaler
from
sklearn.preprocessing
import
MinMaxScaler
import
plotly.graph_objects
as
go
import
plotly.graph_objects
as
go
import
pandas
as
pd
import
pandas
as
pd
import
numpy
as
np
import
numpy
as
np
import
csv
import
csv
from
matplotlib
import
gridspec
from
matplotlib
import
gridspec
import
seaborn
as
sns
import
seaborn
as
sns
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
```
```
%% Cell type:code id:5a8b764b tags:
%% Cell type:code id:5a8b764b tags:
```
python
```
python
H_users
=
fromDFtoArray
(
path
+
"
code/unsupervised_DT/files_for_dt/train_embed.csv
"
,
False
,
'
f
'
)
H_users
=
fromDFtoArray
(
path
+
"
code/unsupervised_DT/files_for_dt/train_embed.csv
"
,
False
,
'
f
'
)
classPsy
=
fromDFtoArray
(
path
+
"
code/unsupervised_DT/files_for_dt/train_user_quest_label.csv
"
,
False
,
'
f
'
)
classPsy
=
fromDFtoArray
(
path
+
"
code/unsupervised_DT/files_for_dt/train_user_quest_label.csv
"
,
False
,
'
f
'
)
```
```
%% Cell type:code id:33643887 tags:
%% Cell type:code id:33643887 tags:
```
python
```
python
d
=
[
151
,
111
,
57
,
415
,
110
,
73
]
d
=
[
151
,
111
,
57
,
415
,
110
,
73
]
g
=
[[
7
,
14
,
20
,
22
,
23
,
39
,
44
,
53
,
56
,
57
,
62
,
71
,
95
,
100
,
106
,
119
,
122
,
133
,
141
,
142
,
152
,
154
,
156
,
160
,
179
,
182
,
183
,
187
,
188
,
191
,
194
,
198
,
199
,
201
,
203
,
207
,
208
,
214
,
219
,
221
,
224
,
233
,
235
,
241
,
243
,
246
,
252
,
259
,
261
,
265
,
266
,
267
,
271
,
282
,
289
,
293
,
299
,
302
,
303
,
304
,
307
,
308
,
309
,
310
,
312
,
313
,
325
,
327
,
351
,
358
,
385
,
390
,
393
,
396
,
406
,
409
,
415
,
419
,
431
,
435
,
445
,
447
,
448
,
450
,
468
,
479
,
486
,
488
,
490
,
494
,
510
,
516
,
517
,
525
,
546
,
547
,
550
,
551
,
553
,
557
,
559
,
565
,
567
,
578
,
580
,
597
,
600
,
604
,
608
,
611
,
612
,
615
,
640
,
641
,
644
,
656
,
662
,
677
,
679
,
682
,
686
,
688
,
690
,
703
,
709
,
714
,
723
,
732
,
745
,
752
,
776
,
782
,
785
,
786
,
787
,
789
,
792
,
798
,
810
,
829
,
839
,
842
,
844
,
847
,
854
,
866
,
869
,
870
,
881
,
883
,
900
]
g
=
[[
7
,
14
,
20
,
22
,
23
,
39
,
44
,
53
,
56
,
57
,
62
,
71
,
95
,
100
,
106
,
119
,
122
,
133
,
141
,
142
,
152
,
154
,
156
,
160
,
179
,
182
,
183
,
187
,
188
,
191
,
194
,
198
,
199
,
201
,
203
,
207
,
208
,
214
,
219
,
221
,
224
,
233
,
235
,
241
,
243
,
246
,
252
,
259
,
261
,
265
,
266
,
267
,
271
,
282
,
289
,
293
,
299
,
302
,
303
,
304
,
307
,
308
,
309
,
310
,
312
,
313
,
325
,
327
,
351
,
358
,
385
,
390
,
393
,
396
,
406
,
409
,
415
,
419
,
431
,
435
,
445
,
447
,
448
,
450
,
468
,
479
,
486
,
488
,
490
,
494
,
510
,
516
,
517
,
525
,
546
,
547
,
550
,
551
,
553
,
557
,
559
,
565
,
567
,
578
,
580
,
597
,
600
,
604
,
608
,
611
,
612
,
615
,
640
,
641
,
644
,
656
,
662
,
677
,
679
,
682
,
686
,
688
,
690
,
703
,
709
,
714
,
723
,
732
,
745
,
752
,
776
,
782
,
785
,
786
,
787
,
789
,
792
,
798
,
810
,
829
,
839
,
842
,
844
,
847
,
854
,
866
,
869
,
870
,
881
,
883
,
900
]
,
[
4
,
8
,
15
,
28
,
40
,
41
,
42
,
50
,
59
,
84
,
85
,
88
,
89
,
109
,
112
,
123
,
138
,
145
,
146
,
150
,
157
,
158
,
166
,
181
,
186
,
190
,
232
,
234
,
242
,
247
,
248
,
249
,
260
,
272
,
274
,
277
,
281
,
296
,
301
,
338
,
339
,
345
,
352
,
359
,
365
,
388
,
403
,
404
,
412
,
418
,
441
,
443
,
461
,
464
,
478
,
481
,
489
,
491
,
495
,
497
,
500
,
508
,
524
,
531
,
569
,
576
,
587
,
589
,
609
,
610
,
613
,
617
,
620
,
622
,
627
,
637
,
642
,
647
,
673
,
678
,
711
,
712
,
715
,
720
,
726
,
729
,
730
,
758
,
759
,
760
,
788
,
797
,
811
,
815
,
819
,
820
,
821
,
830
,
831
,
840
,
845
,
849
,
862
,
878
,
880
,
884
,
891
,
895
,
898
,
904
,
906
]
,
[
4
,
8
,
15
,
28
,
40
,
41
,
42
,
50
,
59
,
84
,
85
,
88
,
89
,
109
,
112
,
123
,
138
,
145
,
146
,
150
,
157
,
158
,
166
,
181
,
186
,
190
,
232
,
234
,
242
,
247
,
248
,
249
,
260
,
272
,
274
,
277
,
281
,
296
,
301
,
338
,
339
,
345
,
352
,
359
,
365
,
388
,
403
,
404
,
412
,
418
,
441
,
443
,
461
,
464
,
478
,
481
,
489
,
491
,
495
,
497
,
500
,
508
,
524
,
531
,
569
,
576
,
587
,
589
,
609
,
610
,
613
,
617
,
620
,
622
,
627
,
637
,
642
,
647
,
673
,
678
,
711
,
712
,
715
,
720
,
726
,
729
,
730
,
758
,
759
,
760
,
788
,
797
,
811
,
815
,
819
,
820
,
821
,
830
,
831
,
840
,
845
,
849
,
862
,
878
,
880
,
884
,
891
,
895
,
898
,
904
,
906
]
,[
58
,
75
,
80
,
103
,
114
,
161
,
205
,
210
,
211
,
226
,
227
,
236
,
244
,
257
,
258
,
328
,
347
,
356
,
357
,
372
,
380
,
391
,
399
,
400
,
402
,
410
,
455
,
457
,
526
,
558
,
583
,
606
,
614
,
616
,
618
,
624
,
643
,
645
,
660
,
664
,
676
,
691
,
717
,
738
,
755
,
756
,
763
,
771
,
796
,
812
,
817
,
832
,
850
,
861
,
868
,
882
,
912
]
,[
58
,
75
,
80
,
103
,
114
,
161
,
205
,
210
,
211
,
226
,
227
,
236
,
244
,
257
,
258
,
328
,
347
,
356
,
357
,
372
,
380
,
391
,
399
,
400
,
402
,
410
,
455
,
457
,
526
,
558
,
583
,
606
,
614
,
616
,
618
,
624
,
643
,
645
,
660
,
664
,
676
,
691
,
717
,
738
,
755
,
756
,
763
,
771
,
796
,
812
,
817
,
832
,
850
,
861
,
868
,
882
,
912
]
,[
0
,
2
,
3
,
5
,
6
,
9
,
10
,
11
,
12
,
17
,
18
,
24
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
38
,
43
,
46
,
48
,
52
,
54
,
55
,
63
,
64
,
66
,
68
,
69
,
72
,
74
,
76
,
77
,
78
,
79
,
81
,
82
,
87
,
90
,
91
,
92
,
93
,
94
,
98
,
99
,
101
,
102
,
104
,
105
,
107
,
108
,
110
,
111
,
115
,
117
,
120
,
121
,
124
,
126
,
127
,
129
,
130
,
131
,
132
,
134
,
135
,
136
,
137
,
139
,
143
,
144
,
148
,
149
,
151
,
155
,
163
,
167
,
171
,
172
,
173
,
175
,
176
,
177
,
178
,
184
,
189
,
192
,
193
,
195
,
196
,
197
,
200
,
202
,
204
,
206
,
215
,
218
,
222
,
223
,
225
,
229
,
230
,
237
,
238
,
240
,
251
,
253
,
254
,
256
,
262
,
263
,
264
,
268
,
273
,
278
,
279
,
280
,
283
,
284
,
287
,
288
,
290
,
291
,
292
,
294
,
295
,
305
,
306
,
315
,
317
,
318
,
319
,
320
,
321
,
322
,
323
,
324
,
330
,
331
,
332
,
333
,
334
,
336
,
337
,
340
,
342
,
343
,
346
,
350
,
353
,
354
,
355
,
360
,
361
,
363
,
364
,
366
,
367
,
368
,
370
,
371
,
373
,
374
,
376
,
382
,
383
,
386
,
389
,
392
,
394
,
397
,
401
,
407
,
411
,
413
,
414
,
416
,
417
,
423
,
424
,
425
,
426
,
427
,
428
,
429
,
432
,
434
,
437
,
438
,
440
,
442
,
444
,
446
,
449
,
453
,
454
,
456
,
458
,
459
,
462
,
467
,
469
,
471
,
472
,
473
,
475
,
477
,
480
,
482
,
483
,
484
,
485
,
492
,
493
,
496
,
498
,
499
,
502
,
504
,
506
,
507
,
509
,
513
,
515
,
518
,
519
,
520
,
521
,
522
,
523
,
527
,
528
,
529
,
530
,
532
,
533
,
534
,
535
,
536
,
537
,
538
,
539
,
541
,
542
,
543
,
544
,
545
,
549
,
552
,
556
,
560
,
561
,
562
,
563
,
566
,
570
,
571
,
573
,
574
,
575
,
577
,
581
,
582
,
585
,
588
,
591
,
592
,
593
,
594
,
595
,
596
,
598
,
599
,
601
,
602
,
603
,
605
,
607
,
619
,
623
,
625
,
626
,
628
,
629
,
630
,
631
,
632
,
635
,
638
,
639
,
648
,
649
,
650
,
651
,
652
,
654
,
657
,
663
,
667
,
668
,
669
,
670
,
672
,
675
,
681
,
683
,
684
,
692
,
693
,
694
,
695
,
697
,
698
,
700
,
704
,
705
,
706
,
707
,
708
,
710
,
713
,
716
,
718
,
719
,
722
,
724
,
727
,
728
,
731
,
733
,
734
,
735
,
736
,
737
,
740
,
741
,
744
,
747
,
748
,
749
,
750
,
751
,
754
,
757
,
762
,
764
,
765
,
767
,
768
,
770
,
772
,
773
,
774
,
775
,
777
,
778
,
779
,
780
,
781
,
783
,
791
,
793
,
795
,
799
,
800
,
801
,
802
,
803
,
804
,
806
,
808
,
816
,
818
,
822
,
823
,
824
,
825
,
826
,
833
,
836
,
837
,
838
,
841
,
846
,
848
,
851
,
852
,
856
,
857
,
864
,
873
,
875
,
877
,
885
,
886
,
887
,
888
,
889
,
890
,
893
,
894
,
896
,
897
,
899
,
901
,
902
,
903
,
905
,
907
,
909
,
911
,
914
]
,[
0
,
2
,
3
,
5
,
6
,
9
,
10
,
11
,
12
,
17
,
18
,
24
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
38
,
43
,
46
,
48
,
52
,
54
,
55
,
63
,
64
,
66
,
68
,
69
,
72
,
74
,
76
,
77
,
78
,
79
,
81
,
82
,
87
,
90
,
91
,
92
,
93
,
94
,
98
,
99
,
101
,
102
,
104
,
105
,
107
,
108
,
110
,
111
,
115
,
117
,
120
,
121
,
124
,
126
,
127
,
129
,
130
,
131
,
132
,
134
,
135
,
136
,
137
,
139
,
143
,
144
,
148
,
149
,
151
,
155
,
163
,
167
,
171
,
172
,
173
,
175
,
176
,
177
,
178
,
184
,
189
,
192
,
193
,
195
,
196
,
197
,
200
,
202
,
204
,
206
,
215
,
218
,
222
,
223
,
225
,
229
,
230
,
237
,
238
,
240
,
251
,
253
,
254
,
256
,
262
,
263
,
264
,
268
,
273
,
278
,
279
,
280
,
283
,
284
,
287
,
288
,
290
,
291
,
292
,
294
,
295
,
305
,
306
,
315
,
317
,
318
,
319
,
320
,
321
,
322
,
323
,
324
,
330
,
331
,
332
,
333
,
334
,
336
,
337
,
340
,
342
,
343
,
346
,
350
,
353
,
354
,
355
,
360
,
361
,
363
,
364
,
366
,
367
,
368
,
370
,
371
,
373
,
374
,
376
,
382
,
383
,
386
,
389
,
392
,
394
,
397
,
401
,
407
,
411
,
413
,
414
,
416
,
417
,
423
,
424
,
425
,
426
,
427
,
428
,
429
,
432
,
434
,
437
,
438
,
440
,
442
,
444
,
446
,
449
,
453
,
454
,
456
,
458
,
459
,
462
,
467
,
469
,
471
,
472
,
473
,
475
,
477
,
480
,
482
,
483
,
484
,
485
,
492
,
493
,
496
,
498
,
499
,
502
,
504
,
506
,
507
,
509
,
513
,
515
,
518
,
519
,
520
,
521
,
522
,
523
,
527
,
528
,
529
,
530
,
532
,
533
,
534
,
535
,
536
,
537
,
538
,
539
,
541
,
542
,
543
,
544
,
545
,
549
,
552
,
556
,
560
,
561
,
562
,
563
,
566
,
570
,
571
,
573
,
574
,
575
,
577
,
581
,
582
,
585
,
588
,
591
,
592
,
593
,
594
,
595
,
596
,
598
,
599
,
601
,
602
,
603
,
605
,
607
,
619
,
623
,
625
,
626
,
628
,
629
,
630
,
631
,
632
,
635
,
638
,
639
,
648
,
649
,
650
,
651
,
652
,
654
,
657
,
663
,
667
,
668
,
669
,
670
,
672
,
675
,
681
,
683
,
684
,
692
,
693
,
694
,
695
,
697
,
698
,
700
,
704
,
705
,
706
,
707
,
708
,
710
,
713
,
716
,
718
,
719
,
722
,
724
,
727
,
728
,
731
,
733
,
734
,
735
,
736
,
737
,
740
,
741
,
744
,
747
,
748
,
749
,
750
,
751
,
754
,
757
,
762
,
764
,
765
,
767
,
768
,
770
,
772
,
773
,
774
,
775
,
777
,
778
,
779
,
780
,
781
,
783
,
791
,
793
,
795
,
799
,
800
,
801
,
802
,
803
,
804
,
806
,
808
,
816
,
818
,
822
,
823
,
824
,
825
,
826
,
833
,
836
,
837
,
838
,
841
,
846
,
848
,
851
,
852
,
856
,
857
,
864
,
873
,
875
,
877
,
885
,
886
,
887
,
888
,
889
,
890
,
893
,
894
,
896
,
897
,
899
,
901
,
902
,
903
,
905
,
907
,
909
,
911
,
914
]
,[
13
,
16
,
19
,
27
,
37
,
47
,
49
,
60
,
61
,
65
,
67
,
70
,
73
,
83
,
86
,
125
,
128
,
140
,
147
,
153
,
159
,
162
,
165
,
168
,
170
,
185
,
209
,
228
,
239
,
245
,
250
,
269
,
270
,
275
,
285
,
300
,
311
,
314
,
316
,
329
,
341
,
348
,
349
,
362
,
369
,
375
,
377
,
378
,
379
,
384
,
395
,
398
,
408
,
433
,
439
,
452
,
465
,
466
,
470
,
487
,
501
,
503
,
514
,
540
,
548
,
554
,
555
,
564
,
568
,
572
,
584
,
590
,
634
,
653
,
655
,
658
,
659
,
661
,
665
,
666
,
671
,
674
,
696
,
699
,
702
,
721
,
739
,
742
,
746
,
753
,
769
,
784
,
790
,
794
,
809
,
813
,
827
,
828
,
843
,
853
,
855
,
858
,
859
,
860
,
865
,
867
,
874
,
908
,
915
,
916
]
,[
13
,
16
,
19
,
27
,
37
,
47
,
49
,
60
,
61
,
65
,
67
,
70
,
73
,
83
,
86
,
125
,
128
,
140
,
147
,
153
,
159
,
162
,
165
,
168
,
170
,
185
,
209
,
228
,
239
,
245
,
250
,
269
,
270
,
275
,
285
,
300
,
311
,
314
,
316
,
329
,
341
,
348
,
349
,
362
,
369
,
375
,
377
,
378
,
379
,
384
,
395
,
398
,
408
,
433
,
439
,
452
,
465
,
466
,
470
,
487
,
501
,
503
,
514
,
540
,
548
,
554
,
555
,
564
,
568
,
572
,
584
,
590
,
634
,
653
,
655
,
658
,
659
,
661
,
665
,
666
,
671
,
674
,
696
,
699
,
702
,
721
,
739
,
742
,
746
,
753
,
769
,
784
,
790
,
794
,
809
,
813
,
827
,
828
,
843
,
853
,
855
,
858
,
859
,
860
,
865
,
867
,
874
,
908
,
915
,
916
]
,[
1
,
21
,
25
,
26
,
45
,
51
,
96
,
97
,
113
,
116
,
118
,
164
,
169
,
174
,
180
,
212
,
213
,
216
,
217
,
220
,
231
,
255
,
276
,
286
,
297
,
298
,
326
,
335
,
344
,
381
,
387
,
405
,
420
,
421
,
422
,
430
,
436
,
451
,
460
,
463
,
474
,
476
,
505
,
511
,
512
,
579
,
586
,
621
,
633
,
636
,
646
,
680
,
685
,
687
,
689
,
701
,
725
,
743
,
761
,
766
,
805
,
807
,
814
,
834
,
835
,
863
,
871
,
872
,
876
,
879
,
892
,
910
,
913
]
,[
1
,
21
,
25
,
26
,
45
,
51
,
96
,
97
,
113
,
116
,
118
,
164
,
169
,
174
,
180
,
212
,
213
,
216
,
217
,
220
,
231
,
255
,
276
,
286
,
297
,
298
,
326
,
335
,
344
,
381
,
387
,
405
,
420
,
421
,
422
,
430
,
436
,
451
,
460
,
463
,
474
,
476
,
505
,
511
,
512
,
579
,
586
,
621
,
633
,
636
,
646
,
680
,
685
,
687
,
689
,
701
,
725
,
743
,
761
,
766
,
805
,
807
,
814
,
834
,
835
,
863
,
871
,
872
,
876
,
879
,
892
,
910
,
913
]
]
]
```
```
%% Cell type:code id:d190bd89 tags:
%% Cell type:code id:d190bd89 tags:
```
python
```
python
titre
=
[
'
agency
'
,
'
anxiety
'
,
'
avoiding
'
,
'
depression
'
,
'
ext. control
'
,
'
fatigue
'
,
'
hyper vigilance
'
,
titre
=
[
'
agency
'
,
'
anxiety
'
,
'
avoiding
'
,
'
depression
'
,
'
ext. control
'
,
'
fatigue
'
,
'
hyper vigilance
'
,
'
trauma
'
,
'
int. control
'
,
'
memory
'
,
'
problem focused
'
,
'
quality of life
'
,
'
trauma
'
,
'
int. control
'
,
'
memory
'
,
'
problem focused
'
,
'
quality of life
'
,
'
sadness
'
,
'
self efficacy
'
,
'
sleep
'
,
'
social
'
,
'
stress
'
]
'
sadness
'
,
'
self efficacy
'
,
'
sleep
'
,
'
social
'
,
'
stress
'
]
dim
=
len
(
titre
)
dim
=
len
(
titre
)
seuils
=
[
0.38646466
,
0.13056517
,
0.16311094
,
0.5522181
,
0.4068393
,
0.4961518
,
seuils
=
[
0.38646466
,
0.13056517
,
0.16311094
,
0.5522181
,
0.4068393
,
0.4961518
,
-
0.12576449
,
-
0.16419357
,
0.34581536
,
-
0.06974197
,
-
0.25050393
,
0.17414908
,
-
0.12576449
,
-
0.16419357
,
0.34581536
,
-
0.06974197
,
-
0.25050393
,
0.17414908
,
-
0.09691429
,
0.39290804
,
0.37336868
,
-
0.30328006
,
0.23517847
]
-
0.09691429
,
0.39290804
,
0.37336868
,
-
0.30328006
,
0.23517847
]
print
(
len
(
seuils
))
print
(
len
(
seuils
))
indices
=
[]
indices
=
[]
for
i
in
range
(
17
):
for
i
in
range
(
17
):
indices
.
append
([
i
])
indices
.
append
([
i
])
print
(
H_users
.
shape
)
print
(
H_users
.
shape
)
radar
=
[]
radar
=
[]
for
k
in
range
(
len
(
g
)):
for
k
in
range
(
len
(
g
)):
rows
=
H_users
[
g
[
k
]]
rows
=
H_users
[
g
[
k
]]
v
=
np
.
full
(
dim
,
0.0
)
v
=
np
.
full
(
dim
,
0.0
)
for
i
in
range
(
len
(
rows
)):
for
i
in
range
(
len
(
rows
)):
#print(len(rows[i]))
#print(len(rows[i]))
for
j
in
range
(
len
(
rows
[
i
])):
for
j
in
range
(
len
(
rows
[
i
])):
if
(
rows
[
i
][
j
]
>
seuils
[
j
]):
if
(
rows
[
i
][
j
]
>
seuils
[
j
]):
v
[
j
]
=
v
[
j
]
+
1
#rows[i][j]
v
[
j
]
=
v
[
j
]
+
1
#rows[i][j]
if
(
rows
[
i
][
j
]
<
seuils
[
j
]):
if
(
rows
[
i
][
j
]
<
seuils
[
j
]):
v
[
j
]
=
v
[
j
]
-
1
#+ rows[i][j]
v
[
j
]
=
v
[
j
]
-
1
#+ rows[i][j]
v
=
v
/
len
(
rows
)
v
=
v
/
len
(
rows
)
radar
.
append
(
v
)
radar
.
append
(
v
)
print
(
radar
)
print
(
radar
)
scaler
=
MinMaxScaler
()
scaler
=
MinMaxScaler
()
radar
=
scaler
.
fit_transform
(
np
.
array
(
radar
))
radar
=
scaler
.
fit_transform
(
np
.
array
(
radar
))
```
```
%% Cell type:code id:34d43f1e tags:
%% Cell type:code id:34d43f1e tags:
```
python
```
python
print
(
classPsy
.
shape
)
print
(
classPsy
.
shape
)
radar2
=
[]
radar2
=
[]
for
k
in
range
(
len
(
g
)):
for
k
in
range
(
len
(
g
)):
rows
=
classPsy
[
g
[
k
]]
rows
=
classPsy
[
g
[
k
]]
v
=
np
.
full
(
dim
,
0.0
)
v
=
np
.
full
(
dim
,
0.0
)
for
i
in
range
(
len
(
rows
)):
for
i
in
range
(
len
(
rows
)):
for
j
in
range
(
len
(
rows
[
i
])):
for
j
in
range
(
len
(
rows
[
i
])):
if
(
rows
[
i
][
j
]
==
2
):
if
(
rows
[
i
][
j
]
==
2
):
v
[
j
]
=
v
[
j
]
+
1
#rows[i][j]
v
[
j
]
=
v
[
j
]
+
1
#rows[i][j]
if
(
rows
[
i
][
j
]
==
0
):
if
(
rows
[
i
][
j
]
==
0
):
v
[
j
]
=
v
[
j
]
-
1
#+ rows[i][j]
v
[
j
]
=
v
[
j
]
-
1
#+ rows[i][j]
v
=
v
/
len
(
rows
)
v
=
v
/
len
(
rows
)
radar2
.
append
(
v
)
radar2
.
append
(
v
)
print
(
radar2
)
print
(
radar2
)
scaler
=
MinMaxScaler
()
scaler
=
MinMaxScaler
()
radar2
=
scaler
.
fit_transform
(
np
.
array
(
radar2
))
radar2
=
scaler
.
fit_transform
(
np
.
array
(
radar2
))
print
(
radar2
)
print
(
radar2
)
```
```
%% Cell type:code id:acb7d4df tags:
%% Cell type:code id:acb7d4df tags:
```
python
```
python
name_cluster
=
[
'
Trauma
'
,
'
Sadness, stress and memory
'
,
'
Trauma and memory
'
,
'
Memory
'
,
'
Depression and associated symptoms
'
,
'
Depression
'
]
name_cluster
=
[
'
Trauma
'
,
'
Sadness, stress and memory
'
,
'
Trauma and memory
'
,
'
Memory
'
,
'
Depression and associated symptoms
'
,
'
Depression
'
]
categories
=
[
'
processing cost
'
,
'
mechanical properties
'
,
'
chemical stability
'
,
categories
=
[
'
processing cost
'
,
'
mechanical properties
'
,
'
chemical stability
'
,
'
thermal stability
'
,
'
device integration
'
]
'
thermal stability
'
,
'
device integration
'
]
titleGraph
=
[]
titleGraph
=
[]
for
i
in
range
(
len
(
d
)):
for
i
in
range
(
len
(
d
)):
#titleGraph.append('DTCluster ' + str(i))
#titleGraph.append('DTCluster ' + str(i))
titleGraph
.
append
(
'
DTCluster:
'
+
name_cluster
[
i
])
titleGraph
.
append
(
'
DTCluster:
'
+
name_cluster
[
i
])
def
radar_fig
(
i
):
def
radar_fig
(
i
):
fig
=
go
.
Figure
()
fig
=
go
.
Figure
()
fig
.
add_trace
(
go
.
Scatterpolar
(
fig
.
add_trace
(
go
.
Scatterpolar
(
r
=
radar
[
i
],
r
=
radar
[
i
],
theta
=
titre
,
theta
=
titre
,
fill
=
'
toself
'
,
fill
=
'
toself
'
,
name
=
'
H
'
name
=
'
H
'
))
))
fig
.
add_trace
(
go
.
Scatterpolar
(
fig
.
add_trace
(
go
.
Scatterpolar
(
r
=
radar2
[
i
],
r
=
radar2
[
i
],
theta
=
titre
,
theta
=
titre
,
fill
=
'
toself
'
,
fill
=
'
toself
'
,
name
=
'
Class psy
'
name
=
'
Class psy
'
#text = 'r'
#text = 'r'
))
))
fig
.
update_layout
(
fig
.
update_layout
(
polar
=
dict
(
polar
=
dict
(
radialaxis
=
dict
(
radialaxis
=
dict
(
visible
=
True
visible
=
True
#range=[0, 5]
#range=[0, 5]
)),
)),
showlegend
=
False
showlegend
=
False
)
)
fig
.
update_layout
(
title_text
=
titleGraph
[
i
])
fig
.
update_layout
(
title_text
=
titleGraph
[
i
])
fig
.
update_layout
(
fig
.
update_layout
(
font
=
dict
(
font
=
dict
(
#family="Courier New, monospace",
#family="Courier New, monospace",
size
=
18
,
# Set the font size here
size
=
18
,
# Set the font size here
#color="RebeccaPurple"
#color="RebeccaPurple"
)
)
)
)
fig
.
show
()
fig
.
show
()
fig
.
write_image
(
path
+
"
radar
"
+
str
(
i
)
+
"
_fig.png
"
)
fig
.
write_image
(
path
+
"
radar
"
+
str
(
i
)
+
"
_fig.png
"
)
for
i
in
range
(
len
(
d
)):
for
i
in
range
(
len
(
d
)):
radar_fig
(
i
)
radar_fig
(
i
)
```
```
%% Cell type:code id:c03ac5f8 tags:
%% Cell type:code id:c03ac5f8 tags:
```
python
```
python
``
`
``
`
%%
Cell
type
:
code
id
:
39
b0792d
tags
:
%%
Cell
type
:
code
id
:
39
b0792d
tags
:
```
python
```
python
```
```
%% Cell type:code id:fe44084e tags:
%% Cell type:code id:fe44084e tags:
```
python
```
python
```
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment