Using Filters in Tests
Was this helpful?
Was this helpful?
Was this helpful?
equal_to({EXPERIMENT}.loc,'NY')import dbnl
dbnl.login()
proj = dbnl.get_or_create_project(name="My Project")
dbnl.experimental.create_test(
test_spec_dict={
"project_id": proj.id,
"name": "abs diff of mean of correct churn preds of NY users is within 0.2",
"statistic_name": "abs_diff_mean",
"statistic_params": {},
"assertion": {
"name": "less_than_or_equal_to",
"params": {
"other": 0.2
},
},
"statistic_inputs": [
{
"select_query_template": {
"select": "{BASELINE}.pred_correct",
"filter": "equal_to({BASELINE}.loc, 'NY')"
}
},
{
"select_query_template": {
"select": "{EXPERIMENT}.pred_correct",
"filter": "equal_to({EXPERIMENT}.loc, 'NY')"
}
},
],
}
)