Search in sources :

Example 1 with FixedCategoricalEntity

use of org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedCategoricalEntity in project kogito-apps by kiegroup.

the class CounterfactualEntityFactoryTest method testFixedCategoricalEntity.

@Test
void testFixedCategoricalEntity() {
    final String value = "foo";
    final Feature feature = FeatureFactory.newCategoricalFeature("categorical-feature", value);
    final CounterfactualEntity counterfactualEntity = CounterfactualEntityFactory.from(feature);
    assertTrue(counterfactualEntity instanceof FixedCategoricalEntity);
    assertEquals(value, counterfactualEntity.asFeature().getValue().toString());
}
Also used : CounterfactualEntity(org.kie.kogito.explainability.local.counterfactual.entities.CounterfactualEntity) FixedCategoricalEntity(org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedCategoricalEntity) Feature(org.kie.kogito.explainability.model.Feature) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 CounterfactualEntity (org.kie.kogito.explainability.local.counterfactual.entities.CounterfactualEntity)1 FixedCategoricalEntity (org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedCategoricalEntity)1 Feature (org.kie.kogito.explainability.model.Feature)1