Search in sources :

Example 1 with FixedVectorEntity

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

the class CounterfactualEntityFactoryTest method testVectorFactory.

@Test
void testVectorFactory() {
    final double[] value = new double[10];
    Arrays.fill(value, 1d);
    final Feature feature = FeatureFactory.newVectorFeature("uri-feature", value);
    CounterfactualEntity counterfactualEntity = CounterfactualEntityFactory.from(feature);
    assertTrue(counterfactualEntity instanceof FixedVectorEntity);
    assertEquals(Type.VECTOR, counterfactualEntity.asFeature().getType());
}
Also used : CounterfactualEntity(org.kie.kogito.explainability.local.counterfactual.entities.CounterfactualEntity) FixedVectorEntity(org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedVectorEntity) 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 FixedVectorEntity (org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedVectorEntity)1 Feature (org.kie.kogito.explainability.model.Feature)1