Search in sources :

Example 1 with LongEntity

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

the class CounterfactualEntityFactoryTest method testLongFactory.

@Test
void testLongFactory() {
    final long value = 5;
    final FeatureDomain domain = NumericalFeatureDomain.create(0.0, 10.0);
    final Feature feature = FeatureFactory.newNumericalFeature("long-feature", value, domain);
    final CounterfactualEntity counterfactualEntity = CounterfactualEntityFactory.from(feature);
    assertNotNull(counterfactualEntity);
    assertTrue(counterfactualEntity instanceof LongEntity);
    assertEquals(value, counterfactualEntity.asFeature().getValue().asNumber());
}
Also used : CounterfactualEntity(org.kie.kogito.explainability.local.counterfactual.entities.CounterfactualEntity) FixedLongEntity(org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedLongEntity) LongEntity(org.kie.kogito.explainability.local.counterfactual.entities.LongEntity) ObjectFeatureDomain(org.kie.kogito.explainability.model.domain.ObjectFeatureDomain) EmptyFeatureDomain(org.kie.kogito.explainability.model.domain.EmptyFeatureDomain) CategoricalFeatureDomain(org.kie.kogito.explainability.model.domain.CategoricalFeatureDomain) CurrencyFeatureDomain(org.kie.kogito.explainability.model.domain.CurrencyFeatureDomain) URIFeatureDomain(org.kie.kogito.explainability.model.domain.URIFeatureDomain) DurationFeatureDomain(org.kie.kogito.explainability.model.domain.DurationFeatureDomain) TimeFeatureDomain(org.kie.kogito.explainability.model.domain.TimeFeatureDomain) NumericalFeatureDomain(org.kie.kogito.explainability.model.domain.NumericalFeatureDomain) BinaryFeatureDomain(org.kie.kogito.explainability.model.domain.BinaryFeatureDomain) FeatureDomain(org.kie.kogito.explainability.model.domain.FeatureDomain) 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 LongEntity (org.kie.kogito.explainability.local.counterfactual.entities.LongEntity)1 FixedLongEntity (org.kie.kogito.explainability.local.counterfactual.entities.fixed.FixedLongEntity)1 Feature (org.kie.kogito.explainability.model.Feature)1 BinaryFeatureDomain (org.kie.kogito.explainability.model.domain.BinaryFeatureDomain)1 CategoricalFeatureDomain (org.kie.kogito.explainability.model.domain.CategoricalFeatureDomain)1 CurrencyFeatureDomain (org.kie.kogito.explainability.model.domain.CurrencyFeatureDomain)1 DurationFeatureDomain (org.kie.kogito.explainability.model.domain.DurationFeatureDomain)1 EmptyFeatureDomain (org.kie.kogito.explainability.model.domain.EmptyFeatureDomain)1 FeatureDomain (org.kie.kogito.explainability.model.domain.FeatureDomain)1 NumericalFeatureDomain (org.kie.kogito.explainability.model.domain.NumericalFeatureDomain)1 ObjectFeatureDomain (org.kie.kogito.explainability.model.domain.ObjectFeatureDomain)1 TimeFeatureDomain (org.kie.kogito.explainability.model.domain.TimeFeatureDomain)1 URIFeatureDomain (org.kie.kogito.explainability.model.domain.URIFeatureDomain)1