Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
codecritic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ziyuan Nan
codecritic
Commits
99bd77f6
Commit
99bd77f6
authored
Oct 05, 2024
by
nanziyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
step1 sort_split_dataset fix bugs
parent
2ab59c74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
step1_sort_split_dataset.py
+3
-4
No files found.
step1_sort_split_dataset.py
View file @
99bd77f6
...
@@ -49,7 +49,7 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
...
@@ -49,7 +49,7 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
assert
len
(
new_test
)
%
n
==
0
assert
len
(
new_test
)
%
n
==
0
for
i
in
range
(
len
(
new_test
)
//
n
):
for
i
in
range
(
len
(
new_test
)
//
n
):
problem
=
new_test
[
i
*
n
:
(
i
+
1
)
*
n
]
problem
=
new_test
[
i
*
n
:
(
i
+
1
)
*
n
]
has_correct_solution
=
a
ll
(
d
[
"eval_result"
]
for
d
in
problem
)
has_correct_solution
=
a
ny
(
d
[
"eval_result"
]
for
d
in
problem
)
if
has_correct_solution
:
if
has_correct_solution
:
minimal_test
.
extend
(
problem
)
minimal_test
.
extend
(
problem
)
...
@@ -59,11 +59,11 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
...
@@ -59,11 +59,11 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
cfg
=
read_config
cfg
=
read_config
()
sort_and_split_dataset
(
sort_and_split_dataset
(
cfg
[
"evaluate"
][
"evaluate_result_path"
],
cfg
[
"evaluate"
][
"evaluate_result_path"
],
cfg
[
"dataset"
][
"train_path"
],
cfg
[
"dataset"
][
"train_path"
],
cfg
[
"dataset"
][
"test_path"
],
cfg
[
"dataset"
][
"test_path"
],
cfg
[
"dataset"
][
"minimal_test_path"
],
cfg
[
"dataset"
][
"minimal_test_path"
],
cfg
[
"sample"
][
"sampling_params"
][
"n"
]
cfg
[
"sample"
][
"sampling_params"
][
"n"
]
)
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment