Closed andresrcs closed 7 years ago
Can i get you to try it with the latest version of lime from GitHub?
The previous error message is gone but now there is a new one
explanation <- explain(as.data.frame(test[1:5,]), explainer, n_features = 5)
#> Error in glmnet(x[, c(features, j), drop = FALSE], y, weights = weights, : x should be a matrix with 2 or more columns
Ok, so the reason for that error is quite specific to your dataset. Basically you have a single column (index.num
) whose range is so extreme that, due to the fact that you do not bin continuous variables, completely dominates your dataset when it comes to calculating the similarity of the permutations. Basically all permutations gets weighted with 0 resulting in errors in the model fit.
Based on the name and the values I would throw that column out unless you have very good reasons to keep it. If you really need it, then either play with the kernel_size
parameter or use bin_continuous = TRUE
(the latter will give more interpretable explanations anyway)
I've added a meaningful error message for cases like yours were the similarity of the permutations to the original observation is zero and a local model cannot be created
Hi, can you please check again into issue #46 ? Just for curiosity I tried droping the
month.lbl
variable and now I dont get the warning message but stil have the same error message even though my training data covers the full feature space.