Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add interesting cases for multi -d support #3897

Merged
merged 4 commits into from Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/tests/test_vwconfig.py
Expand Up @@ -19,8 +19,8 @@ def test_vw_config_manager():
expected_set = {
"--no_stdin",
"--quiet",
"--loss_function logistic",
"--data test/train-sets/rcv1_small.dat",
"--loss_function=logistic",
"--data=test/train-sets/rcv1_small.dat",
}
expected_reductions = {"gd", "scorer-identity", "count_label"}

Expand Down
5 changes: 2 additions & 3 deletions python/vowpalwabbit/pyvw.py
Expand Up @@ -176,11 +176,10 @@ def __str__(self):
if self.is_flag():
return "--{}".format(self.name)
else:
# missing list case
if isinstance(self.value, list):
return "**NOT_IMPL**"
return " ".join(map(lambda x: f"--{self.name}={x}", self.value))
else:
return "--{} {}".format(self.name, self.value)
return "--{}={}".format(self.name, self.value)
else:
return ""

Expand Down
86 changes: 86 additions & 0 deletions test/core.vwtest.json
Expand Up @@ -5123,5 +5123,91 @@
"input_files": [
"train-sets/cb_l_namespace.txt"
]
},
{
"id": 399,
"desc": "test multi d -- based on test 316 to share same metrics of the complete file dsjson_cb.json (which is split into two here)",
"bash_command": "./negative-test.sh {VW} -d train-sets/dsjson_cb_part1.json -d train-sets/dsjson_cb_part2.json --dsjson --cb_explore_adf --epsilon 0.2 --quadratic GT --extra_metrics metrics_time.json",
"diff_files": {
"stdout": "train-sets/ref/metrics_time_fail.stdout",
"stderr": "train-sets/ref/multid_fail.stderr"
},
"input_files": [
"./negative-test.sh",
"train-sets/dsjson_cb_part1.json",
"train-sets/dsjson_cb_part2.json"
]
},
{
"id": 400,
"desc": "test multi d positional -- based on test 316 to share same metrics of the complete file dsjson_cb.json (which is split into two here)",
"vw_command": "--dsjson --cb_explore_adf --epsilon 0.2 --quadratic GT --extra_metrics metrics_time.json train-sets/dsjson_cb_part1.json train-sets/dsjson_cb_part2.json",
"diff_files": {
"metrics_time.json": "test-sets/ref/metrics_time_one.json",
"stdout": "train-sets/ref/metrics_time_one.stdout",
"stderr": "train-sets/ref/multid_one.stderr"
},
"input_files": [
"train-sets/dsjson_cb_part1.json",
"train-sets/dsjson_cb_part2.json"
]
},
{
"id": 401,
"desc": "test multi d - see test 121 cb_explore",
"bash_command": "./negative-test.sh {VW} -d train-sets/rcv1_raw_cb_small_p1.vw -d train-sets/rcv1_raw_cb_small_p2.vw --cb_explore 2 --ngram 2 --skips 4 -b 24 -l 0.25 -p rcv1_raw_cb_explore.preds",
"diff_files": {
"stderr": "train-sets/ref/rcv1_raw_cb_explore_pass2_split.stderr",
"rcv1_raw_cb_explore.preds": "pred-sets/ref/rcv1_raw_cb_explore_pass2_empty.preds",
"stdout": "train-sets/ref/rcv1_raw_cb_explore_pass2_fail.stdout"
},
"input_files": [
"./negative-test.sh",
"train-sets/rcv1_raw_cb_small_p1.vw",
"train-sets/rcv1_raw_cb_small_p2.vw"
]
},
{
"id": 402,
"desc": "cb_explore - passes 2",
"vw_command": "-d train-sets/rcv1_raw_cb_small.vw --cb_explore 2 --ngram 2 --skips 4 -b 24 -l 0.25 -p rcv1_raw_cb_explore.preds --passes 2 -c -k",
"diff_files": {
"stderr": "train-sets/ref/rcv1_raw_cb_explore_pass2.stderr",
"rcv1_raw_cb_explore.preds": "pred-sets/ref/rcv1_raw_cb_explore_pass2.preds",
"stdout": "train-sets/ref/rcv1_raw_cb_explore_pass2.stdout"
},
"input_files": [
"train-sets/rcv1_raw_cb_small.vw"
]
},
{
"id": 403,
"desc": "previous but with split files - cb_explore - passes 2",
"bash_command": "./negative-test.sh {VW} -d train-sets/rcv1_raw_cb_small_p1.vw -d train-sets/rcv1_raw_cb_small_p2.vw --cb_explore 2 --ngram 2 --skips 4 -b 24 -l 0.25 -p rcv1_raw_cb_explore.preds --passes 2 -c -k --single_cache_file",
"diff_files": {
"stderr": "train-sets/ref/rcv1_raw_cb_explore_pass2_split.stderr",
"rcv1_raw_cb_explore.preds": "pred-sets/ref/rcv1_raw_cb_explore_pass2_empty.preds",
"stdout": "train-sets/ref/rcv1_raw_cb_explore_pass2_fail.stdout"
},
"input_files": [
"./negative-test.sh",
"train-sets/rcv1_raw_cb_small_p1.vw",
"train-sets/rcv1_raw_cb_small_p2.vw"
]
},
{
"id": 404,
"desc": "test multi d positional mixed with -d, this should fail",
"vw_command": "--dsjson --cb_explore_adf --epsilon 0.2 train-sets/dsjson_cb_part2.json --quadratic GT --extra_metrics metrics_time.json -d train-sets/dsjson_cb_part1.json",
"diff_files": {
"stderr": "train-sets/ref/multid_mixed.stderr",
"stdout": "train-sets/ref/multid_mixed.stdout"
},
"input_files": [
"train-sets/dsjson_cb_part1.json",
"train-sets/dsjson_cb_part2.json"
]
}


]