From 5b051346fa218b345ef892a3db3514f3e8bc652e Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Fri, 30 Jul 2021 09:59:49 -0400 Subject: [PATCH] Fixing an NPE in LIMEExplanation.getActiveFeatures() with some explanation models. --- .../classification/explanations/lime/LIMEExplanation.java | 8 +++++++- .../explanations/lime/LIMEColumnarTest.java | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Classification/Explanations/src/main/java/org/tribuo/classification/explanations/lime/LIMEExplanation.java b/Classification/Explanations/src/main/java/org/tribuo/classification/explanations/lime/LIMEExplanation.java index 686064cd1..85b48c9bf 100644 --- a/Classification/Explanations/src/main/java/org/tribuo/classification/explanations/lime/LIMEExplanation.java +++ b/Classification/Explanations/src/main/java/org/tribuo/classification/explanations/lime/LIMEExplanation.java @@ -25,6 +25,7 @@ import org.tribuo.regression.evaluation.RegressionEvaluation; import java.util.List; +import java.util.Map; /** * An {@link Explanation} using LIME. @@ -56,7 +57,12 @@ public LIMEExplanation(SparseModel model, Prediction