Open samuelamico opened 1 year ago
Hi, @samuelamico,
In new version we changed internal structure because we have some dependencies between tests/metrics and other metrics. So it is incorrect to call Test / Metric directly.
Can you describe why you want use Test / Metric directly without Reports / TestSuites?
Hi @Liraim thanks for the heads up. My goal is to use the change the default value using a reference dataset. In the documentation:
With reference: if the Accuracy is over 20% higher or lower, the test fails.
I want to change the 0.20 value in the approx to other value.
I see, First, we will add parameter to change this value in tests in future versions.
Second, for now you can use "hack" to alter behavior of test, for example using this code:
from evidently.tests.base_test import TestValueCondition
from evidently.tests.utils import approx
def fixed_condition(obj):
if obj.condition.has_condition():
return obj.condition
result = obj.metric.get_result()
ref_metrics = result.reference
if ref_metrics is not None:
return TestValueCondition(eq=approx(obj.get_value(ref_metrics), relative=0.1)) # here the fix
dummy_result = obj.dummy_metric.get_result().dummy
if obj.get_value(dummy_result) is None:
raise ValueError("Neither required test parameters nor reference data has been provided.")
return TestValueCondition(gt=obj.get_value(dummy_result))
TestAccuracyScore.get_condition = fixed_condition
This should change behavior on TestAccuracyScore globally.
Third, I'm still curious why you want to use Test without TestSuite/
Hello, I'm trying to run the Test: TestAccuracyScore, manually, however I'm getting an Error using the earlier version 0.2 In the previous version the code was running fine.
My code:
ERROR: