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
e1944e19
Commit
e1944e19
authored
1 year ago
by
Céline Robardet
Browse files
Options
Downloads
Patches
Plain Diff
indentation
parent
ad5823ce
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/binary_bpr_ablation/script_ablation.py
+2
-2
2 additions, 2 deletions
code/binary_bpr_ablation/script_ablation.py
code/nary_model/main_nary_cv.py
+1
-1
1 addition, 1 deletion
code/nary_model/main_nary_cv.py
with
3 additions
and
3 deletions
code/binary_bpr_ablation/script_ablation.py
+
2
−
2
View file @
e1944e19
import
os
name
=
[
"
assist09
"
,
"
assist17
"
,
"
algebra
"
,
"
math1
"
,
"
math2
"
]
name
=
[
"
assist09
10_tkde
"
,
"
assist17
_tkde
"
,
"
algebra
"
,
"
math
_
1
"
,
"
math
_
2
"
]
for
i
in
range
(
4
):
print
(
"
Ablation (0 no ablation, 1 ablation L2, 2 ablation init, 3 both)
"
,
i
)
for
a
in
range
(
5
):
print
(
name
[
i
])
cmd
=
"
python main.py --dataTrain ../data/
"
+
name
[
i
]
+
"
/train.csv --dataTest ../data/
"
+
name
[
i
]
+
"
/test.csv --ablation
"
+
str
(
i
)
cmd
=
"
python main.py --dataTrain
../
../data/
"
+
name
[
i
]
+
"
/train
_0
.csv --dataTest
../
../data/
"
+
name
[
i
]
+
"
/test
_0
.csv --ablation
"
+
str
(
i
)
os
.
system
(
cmd
)
This diff is collapsed.
Click to expand it.
code/nary_model/main_nary_cv.py
+
1
−
1
View file @
e1944e19
...
...
@@ -48,7 +48,7 @@ def evaluate_all(dataTrain, dataTest, filename):
new_embedding_items
=
bpr_model
.
item_embeddings
.
weight
.
clone
().
detach
().
cpu
().
numpy
()
write_file
(
filename
+
"
embedding_items.csv
"
,
new_embedding_items
[
0
:
nb_item_train
])
# Test
acc
,
precision
,
rappel
,
all_decisions
=
bpr_model
.
evaluate_model
(
test
,
len
(
dico_kc
),
y_test
)
acc
,
precision
,
rappel
,
all_decisions
,
all_prefs
=
bpr_model
.
evaluate_model
(
test
,
len
(
dico_kc
),
y_test
)
'''
s = str(acc) +
"
,
"
+ str( precision)+
"
,
"
+str(rappel)+
"
,
"
+str(doa)
for i in range(embedding_size):
...
...
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