use of org.kie.kogito.explainability.model.domain.EmptyFeatureDomain in project kogito-apps by kiegroup.
the class ConversionUtilsTest method testToFeatureDomain_UnitFixedNumber.
@Test
void testToFeatureDomain_UnitFixedNumber() {
FeatureDomain featureDomain = ConversionUtils.toFeatureDomain(new CounterfactualSearchDomainUnitValue("integer", "integer", true, null));
assertTrue(featureDomain instanceof EmptyFeatureDomain);
}
use of org.kie.kogito.explainability.model.domain.EmptyFeatureDomain in project kogito-apps by kiegroup.
the class CounterfactualExplainerServiceHandlerTest method testGetPredictionWithFlatSearchDomainsFixed.
@Test
public void testGetPredictionWithFlatSearchDomainsFixed() {
CounterfactualExplainabilityRequest request = new CounterfactualExplainabilityRequest(EXECUTION_ID, SERVICE_URL, MODEL_IDENTIFIER, COUNTERFACTUAL_ID, List.of(new NamedTypedValue("output1", new UnitValue("number", new IntNode(25)))), Collections.emptyList(), List.of(new CounterfactualSearchDomain("output1", new CounterfactualSearchDomainUnitValue("number", "number", true, new CounterfactualDomainRange(new IntNode(10), new IntNode(20))))), MAX_RUNNING_TIME_SECONDS);
Prediction prediction = handler.getPrediction(request);
assertTrue(prediction instanceof CounterfactualPrediction);
CounterfactualPrediction counterfactualPrediction = (CounterfactualPrediction) prediction;
assertEquals(1, counterfactualPrediction.getInput().getFeatures().size());
Feature feature1 = counterfactualPrediction.getInput().getFeatures().get(0);
assertTrue(feature1.getDomain() instanceof EmptyFeatureDomain);
assertEquals(counterfactualPrediction.getMaxRunningTimeSeconds(), request.getMaxRunningTimeSeconds());
}
use of org.kie.kogito.explainability.model.domain.EmptyFeatureDomain in project kogito-apps by kiegroup.
the class ConversionUtilsTest method testToFeatureDomain_UnitFixedString.
@Test
void testToFeatureDomain_UnitFixedString() {
FeatureDomain featureDomain = ConversionUtils.toFeatureDomain(new CounterfactualSearchDomainUnitValue("string", "string", true, null));
assertTrue(featureDomain instanceof EmptyFeatureDomain);
}
Aggregations