3030
3131public class ConfidenceIntervalTests extends AbstractScalarFunctionTestCase {
3232
33+ private static final String EVALUATOR_STRING =
34+ "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], "
35+ + "trialCountBlock=Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ;
36+
3337 @ ParametersFactory
3438 public static Iterable <Object []> parameters () {
3539 List <TestCaseSupplier > suppliers = List .of (
@@ -73,8 +77,7 @@ private static TestCaseSupplier randomBuckets() {
7377 new TestCaseSupplier .TypedData (bucketCount , DataType .INTEGER , "bucketCount" ),
7478 new TestCaseSupplier .TypedData (confidenceLevel , DataType .DOUBLE , "confidenceLevel" )
7579 ),
76- "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], trialCountBlock="
77- + "Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ,
80+ EVALUATOR_STRING ,
7881 DataType .DOUBLE ,
7982 contains (
8083 both (greaterThan (0.0 )).and (lessThan (bestEstimate )),
@@ -102,8 +105,7 @@ private static TestCaseSupplier allBucketsFilled() {
102105 new TestCaseSupplier .TypedData (5 , DataType .INTEGER , "bucketCount" ),
103106 new TestCaseSupplier .TypedData (0.8 , DataType .DOUBLE , "confidence_level" )
104107 ),
105- "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], trialCountBlock="
106- + "Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ,
108+ EVALUATOR_STRING ,
107109 DataType .DOUBLE ,
108110 contains (closeTo (1.8293144967855208 , 1e-9 ), closeTo (2.164428203663303 , 1e-9 ), closeTo (1.0 , 1e-9 ))
109111 )
@@ -126,8 +128,7 @@ private static TestCaseSupplier nanBuckets_ignoreNan() {
126128 new TestCaseSupplier .TypedData (5 , DataType .INTEGER , "bucketCount" ),
127129 new TestCaseSupplier .TypedData (0.8 , DataType .DOUBLE , "confidence_level" )
128130 ),
129- "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], trialCountBlock="
130- + "Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ,
131+ EVALUATOR_STRING ,
131132 DataType .DOUBLE ,
132133 contains (closeTo (1.8443260740876288 , 1e-9 ), closeTo (2.164997868635109 , 1e-9 ), closeTo (0.0 , 1e-9 ))
133134 )
@@ -150,8 +151,7 @@ private static TestCaseSupplier nanBuckets_zeroNan() {
150151 new TestCaseSupplier .TypedData (5 , DataType .INTEGER , "bucketCount" ),
151152 new TestCaseSupplier .TypedData (0.8 , DataType .DOUBLE , "confidence_level" )
152153 ),
153- "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], trialCountBlock="
154- + "Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ,
154+ EVALUATOR_STRING ,
155155 DataType .DOUBLE ,
156156 contains (closeTo (0.4041519539094244 , 1e-9 ), closeTo (1.6023321533418913 , 1e-9 ), closeTo (0.0 , 1e-9 ))
157157 )
@@ -174,8 +174,7 @@ private static TestCaseSupplier inconsistentData() {
174174 new TestCaseSupplier .TypedData (5 , DataType .INTEGER , "bucketCount" ),
175175 new TestCaseSupplier .TypedData (0.8 , DataType .DOUBLE , "confidence_level" )
176176 ),
177- "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], trialCountBlock="
178- + "Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ,
177+ EVALUATOR_STRING ,
179178 DataType .DOUBLE ,
180179 nullValue ()
181180 )
@@ -198,8 +197,7 @@ private static TestCaseSupplier manyNans() {
198197 new TestCaseSupplier .TypedData (5 , DataType .INTEGER , "bucketCount" ),
199198 new TestCaseSupplier .TypedData (0.8 , DataType .DOUBLE , "confidence_level" )
200199 ),
201- "ConfidenceIntervalEvaluator[bestEstimateBlock=Attribute[channel=0], estimatesBlock=Attribute[channel=1], trialCountBlock="
202- + "Attribute[channel=2], bucketCountBlock=Attribute[channel=3], confidenceLevelBlock=Attribute[channel=4]]" ,
200+ EVALUATOR_STRING ,
203201 DataType .DOUBLE ,
204202 nullValue ()
205203 )
0 commit comments