evidently
evidently copied to clipboard
Add relative percent change to TestColumnShareOfMissingValues
Add relative percent change to TestColumnShareOfMissingValues
I want to be able to make a test pass/fail if the relative percent change of null values exceeds a certain threshold. I understand that the default behavior for the test is to fail if the share of missing values in a column is over 10% higher than in reference. as stated in this section of the doc. I would ideally like to change this 10%
value to something else. I understand the lt parameter can be set, however that set the absolute threshold with no relation back to the reference dataset. Is there a way to do this?
Here is how I am currently using/creating the test:
tests = []
tests.append(
generate_column_tests(
TestColumnShareOfMissingValues,
columns="all",
parameters={"lt": missing_values_threshold},
)
)
test_suite = TestSuite(tests=suite_tests)
Instead of using the lt
parameter in the above code snippet, Id ideally like to pass a different parameter that sets the relative percent change threshold from the reference to the current dataset.
Hi, @elutins - it is a great feature request, and we'd like to implement similar functionality eventually. However, right now, it is not possible to set a custom condition relative to the reference.
You can either:
- use the default auto-generated relative test conditions
- set custom absolute conditions
- set custom conditions relative to an absolute value using
approx
https://docs.evidentlyai.com/user-guide/tests-and-reports/custom-test-suite#custom-conditions-with-approx (you still need to set the value you are referring to).
sounds good - thanks for the update. would be a great feature