Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mnist-code-evaluator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
AIcrowd
mnist-code-evaluator
Commits
0e4dc1c8
Commit
0e4dc1c8
authored
3 years ago
by
Jyotish P
Browse files
Options
Downloads
Patches
Plain Diff
Add local tests
parent
416c43d5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
data/predict.py
+1
-1
1 addition, 1 deletion
data/predict.py
evaluator.py
+8
-3
8 additions, 3 deletions
evaluator.py
test/ground_truth/test_ground_truth.csv
+9
-0
9 additions, 0 deletions
test/ground_truth/test_ground_truth.csv
test/shared/predictions.csv
+9
-0
9 additions, 0 deletions
test/shared/predictions.csv
with
27 additions
and
4 deletions
data/predict.py
+
1
−
1
View file @
0e4dc1c8
...
@@ -37,7 +37,7 @@ def append_results(results):
...
@@ -37,7 +37,7 @@ def append_results(results):
def
main
():
def
main
():
predictor
=
initialize_predictor
()
predictor
=
initialize_predictor
()
test_data
=
pd
.
read_csv
(
Constants
.
TEST_DATA_PATH
)
test_data
=
pd
.
read_csv
(
Constants
.
TEST_DATA_PATH
,
header
=
None
)
for
_
,
row
in
test_data
.
iterrows
():
for
_
,
row
in
test_data
.
iterrows
():
result
=
predict_batch
(
predictor
,
[
row
])
result
=
predict_batch
(
predictor
,
[
row
])
...
...
This diff is collapsed.
Click to expand it.
evaluator.py
+
8
−
3
View file @
0e4dc1c8
...
@@ -7,8 +7,7 @@ from sklearn.metrics import f1_score, log_loss
...
@@ -7,8 +7,7 @@ from sklearn.metrics import f1_score, log_loss
class
Constants
:
class
Constants
:
SHARED_DISK
=
os
.
getenv
(
"
AICROWD_SHARED_DIR
"
,
"
test/shared
"
)
SHARED_DISK
=
os
.
getenv
(
"
AICROWD_SHARED_DIR
"
,
"
test/shared
"
)
PREDICTIONS_DIR
=
os
.
getenv
(
"
AICROWD_PREDICTIONS_DIR
"
,
"
test/predictions
"
)
GROUND_TRUTH_DIR
=
os
.
getenv
(
"
AICROWD_GROUND_TRUTH_DIR
"
,
"
test/ground_truth
"
)
GROUND_TRUTH_DIR
=
os
.
getenv
(
"
AICROWD_GROUND_TRUTH_DIR
"
,
"
test
"
)
PREDICTIONS_FILE_PATH
=
os
.
path
.
join
(
SHARED_DISK
,
"
predictions.csv
"
)
PREDICTIONS_FILE_PATH
=
os
.
path
.
join
(
SHARED_DISK
,
"
predictions.csv
"
)
GROUND_TRUTH_PATH
=
os
.
path
.
join
(
GROUND_TRUTH_DIR
,
"
test_ground_truth.csv
"
)
GROUND_TRUTH_PATH
=
os
.
path
.
join
(
GROUND_TRUTH_DIR
,
"
test_ground_truth.csv
"
)
...
@@ -27,7 +26,7 @@ class AIcrowdEvaluator:
...
@@ -27,7 +26,7 @@ class AIcrowdEvaluator:
labels
=
[
i
for
i
in
range
(
0
,
10
)]
labels
=
[
i
for
i
in
range
(
0
,
10
)]
y_pred
=
np
.
zeros
((
len
(
predictions
),
len
(
labels
)))
y_pred
=
np
.
zeros
((
len
(
predictions
),
len
(
labels
)))
for
index
,
val
in
enumerate
(
submiss
ion
):
for
index
,
val
in
enumerate
(
predict
ion
s
):
y_pred
[
index
][
val
]
=
1
y_pred
[
index
][
val
]
=
1
...
@@ -39,3 +38,9 @@ class AIcrowdEvaluator:
...
@@ -39,3 +38,9 @@ class AIcrowdEvaluator:
"
score_secondary
"
:
log_loss_score
,
"
score_secondary
"
:
log_loss_score
,
}
}
if
__name__
==
"
__main__
"
:
evaluator
=
AIcrowdEvaluator
()
score
=
evaluator
.
evaluate
()
print
(
score
)
This diff is collapsed.
Click to expand it.
test/ground_truth/test_ground_truth.csv
0 → 100644
+
9
−
0
View file @
0e4dc1c8
2
3
6
1
2
4
6
9
0
This diff is collapsed.
Click to expand it.
test/shared/predictions.csv
0 → 100644
+
9
−
0
View file @
0e4dc1c8
1
2
3
4
5
6
7
8
9
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