Closed asheetal closed 5 years ago
Hello,
I am having similar issue following this code. Everything went well when using it on images but here it throws the dimnames error.
Thanks for this package, I am exploring it and I am finding it really useful and powerful.
Cheers, Mathieu
I am using keras with cntk backend, continuous output value regression. The error happens when I use explain function. Complaining that the dimnames are not correct in the test dataframe. Any suggestions? Below is the traceback stack. Both train and test are dataframes with exactly same number of named columns. Test has only one observation.
">"explanation <- lime::lime(x=train, model=model, bin_continuous = FALSE, quantile_bins=FALSE) ">" lime::explain(test, explanation, n_features=2) Error in dimnames<-.data.frame(tmp, value = list(n)) : invalid 'dimnames' given for data frame ">" traceback() 13: stop("invalid 'dimnames' given for data frame") 12: dimnames<-.data.frame(tmp, value = list(n)) 11: dimnames<-(tmp, value = list(n)) 10: as.array.default(newdata) 9: as.array(newdata) 8: is_tensorflow_dataset(x) 7: resolve_tensorflow_dataset(x) 6: predict.keras.engine.training.Model(x, as.array(newdata)) 5: predict(x, as.array(newdata)) 4: predict_model.keras.engine.training.Model(explainer$preprocess(explainer$model), case_perm, type = o_type) 3: predict_model(explainer$preprocess(explainer$model), case_perm, type = o_type) 2: explain.data.frame(test, explanation, n_features = 2) 1: lime::explain(test, explanation, n_features = 2)