Skip to content

Commit

Permalink
test: [RLOS2023][WIP] add option for storing output and grid language…
Browse files Browse the repository at this point in the history
… redefinition (#4627)

* test: redesign grid lang

* test: add option for store output

* test: change list to dict for config vars
  • Loading branch information
michiboo authored Jul 28, 2023
1 parent 02fbe55 commit 144912d
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 346 deletions.
18 changes: 18 additions & 0 deletions python/tests/test_framework/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pytest

# conftest.py
def pytest_addoption(parser):
parser.addoption(
"--store_output",
action="store",
default=False,
help="Store output file for tests.",
)


def pytest_configure(config):
_store_output = config.getoption("--store_output")
# Store the custom_arg_value in a global variable or a custom configuration object.
# For example, you can store it in a global variable like this:
global STORE_OUTPUT
STORE_OUTPUT = _store_output
285 changes: 109 additions & 176 deletions python/tests/test_framework/test_configs/cb.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,96 +43,62 @@
}
}
],
"grids": [
{
"grids": {
"g0": {
"#base": [
"--cb_explore 2"
]
},
[
{"*": [
{
"+": [
{
"--epsilon": [
0.1,
0.2,
0.3
]
}
]
},
{
"+": [
{
"--first": [
1,
2
]
}
]
},
{
"+": [
{
"--bag": [
5,
6,
7
]
}
]
},
{
"+": [
{
"--cover": [
1,
2,
3
]
}
]
},
{
"+": [
{
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
}
]
},
{
"+": [
{
"--synthcover": [
""
]
}
]
},
{
"+": [
{
"--regcb": [
""
]
}
]
},
{
"+": [
{
"--softmax": [
""
]
}
]
}
]}
]],
"g1": {
"--epsilon": [
0.1,
0.2,
0.3
]
},
"g2": {
"--first": [
1,
2
]
},
"g3": {
"--bag": [
5,
6,
7
]
},
"g4": {
"--cover": [
1,
2,
3
]
},
"g5": {
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
},
"g6": {
"--synthcover": [
""
]
},
"g7": {
"--regcb": [
""
]
},
"g8": {
"--softmax": [
""
]
}
},
"grids_expression": "g0 * (g1 + g2 + g3 + g4 + g5 +g6 + g7 + g8)",
"output": [
"--readable_model",
"-p"
Expand Down Expand Up @@ -173,21 +139,22 @@
}
}
],
"grids": [
{
"grids": {
"g0": {
"#base": [
"--cb 1 --preserve_performance_counters --save_resume"
]
},
{
"g1": {
"--cb_type": [
"ips",
"mtr",
"dr",
"dm"
]
}
],
},
"grids_expression": "g0 * g1",
"output": [
"--readable_model",
"-p"
Expand Down Expand Up @@ -235,96 +202,62 @@
}
}
],
"grids": [
{
"grids": {
"g0": {
"#base": [
"--cb_explore_adf"
]
},
[
{"*": [
{
"+": [
{
"--epsilon": [
0.1,
0.2,
0.3
]
}
]
},
{
"+": [
{
"--first": [
1,
2
]
}
]
},
{
"+": [
{
"--bag": [
5,
6,
7
]
}
]
},
{
"+": [
{
"--cover": [
1,
2,
3
]
}
]
},
{
"+": [
{
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
}
]
},
{
"+": [
{
"--synthcover": [
""
]
}
]
},
{
"+": [
{
"--regcb": [
""
]
}
]
},
{
"+": [
{
"--softmax": [
""
]
}
]
}
]}
]],
"g1": {
"--epsilon": [
0.1,
0.2,
0.3
]
},
"g2": {
"--first": [
1,
2
]
},
"g3": {
"--bag": [
5,
6,
7
]
},
"g4": {
"--cover": [
1,
2,
3
]
},
"g5": {
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
},
"g6": {
"--synthcover": [
""
]
},
"g7": {
"--regcb": [
""
]
},
"g8": {
"--softmax": [
""
]
}
},
"grids_expression": "g0 * (g1 + g2 + g3 + g4 + g5 +g6 + g7 + g8)",
"output": [
"--readable_model",
"-p"
Expand Down
14 changes: 8 additions & 6 deletions python/tests/test_framework/test_configs/classification.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
}
}
],
"grids": [
{
"grids": {
"g0": {
"#base": [
"--oaa 3"
]
}
],
},
"grids_expression": "g0",
"output": [
"--readable_model",
"-p"
Expand Down Expand Up @@ -85,13 +86,14 @@
}
}
],
"grids": [
{
"grids": {
"g0": {
"#base": [
"--oaa 25"
]
}
],
},
"grids_expression": "g0",
"output": [
"--readable_model",
"-p"
Expand Down
Loading

0 comments on commit 144912d

Please sign in to comment.