use of org.kie.kogito.explainability.PredictionProviderFactory in project kogito-apps by kiegroup.
the class LimeExplainerServiceHandlerTest method setup.
@BeforeEach
public void setup() {
PredictionProviderFactory predictionProviderFactory = mock(PredictionProviderFactory.class);
this.explainer = mock(LimeExplainer.class);
this.handler = new LimeExplainerServiceHandler(explainer, predictionProviderFactory);
}
use of org.kie.kogito.explainability.PredictionProviderFactory in project kogito-apps by kiegroup.
the class CounterfactualExplainerServiceHandlerTest method setup.
@BeforeEach
public void setup() {
PredictionProviderFactory predictionProviderFactory = mock(PredictionProviderFactory.class);
this.explainer = mock(CounterfactualExplainer.class);
this.handler = new CounterfactualExplainerServiceHandler(explainer, predictionProviderFactory, MAX_RUNNING_TIME_MILLISECONDS);
}
use of org.kie.kogito.explainability.PredictionProviderFactory in project kogito-apps by kiegroup.
the class LocalExplainerServiceHandlerRegistryTest method setup.
@BeforeEach
@SuppressWarnings("unchecked")
public void setup() {
LimeExplainer limeExplainer = mock(LimeExplainer.class);
CounterfactualExplainer counterfactualExplainer = mock(CounterfactualExplainer.class);
PredictionProviderFactory predictionProviderFactory = mock(PredictionProviderFactory.class);
limeExplainerServiceHandler = spy(new LimeExplainerServiceHandler(limeExplainer, predictionProviderFactory));
counterfactualExplainerServiceHandler = spy(new CounterfactualExplainerServiceHandler(counterfactualExplainer, predictionProviderFactory, MAX_RUNNING_TIME_SECONDS));
predictionProvider = mock(PredictionProvider.class);
callback = mock(Consumer.class);
when(predictionProviderFactory.createPredictionProvider(any(), any(), any())).thenReturn(predictionProvider);
Instance<LocalExplainerServiceHandler<?, ?>> explanationHandlers = mock(Instance.class);
when(explanationHandlers.stream()).thenReturn(Stream.of(limeExplainerServiceHandler, counterfactualExplainerServiceHandler));
registry = new LocalExplainerServiceHandlerRegistry(explanationHandlers);
}
Aggregations