Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown feature Error for logical column type #75

Closed
rpatel3105 opened this issue Feb 20, 2018 · 2 comments
Closed

Unknown feature Error for logical column type #75

rpatel3105 opened this issue Feb 20, 2018 · 2 comments

Comments

@rpatel3105
Copy link

rpatel3105 commented Feb 20, 2018

Error: Unknown feature type for logical column.
I am getting above error for all logical columns in my data. Your input will be highly appreciated for this issue.

I have checked dataframe.R for lime package but was not able to find condition for is.logical.

@thomasp85
Copy link
Owner

Can I get you to provide a reproducible example

@rpatel3105
Copy link
Author

rpatel3105 commented Feb 20, 2018

library(caret)
library(lime)

# Split up the data set
iris$Sepal.Length <- sample(c(TRUE,FALSE), 150, TRUE)

iris$Sepal.Length <- as.logical(iris$Sepal.Length)
iris_test <- iris[1:5, 1:4]
iris_train <- iris[-(1:5), 1:4]
iris_lab <- iris[[5]][-(1:5)]

# Create Random Forest model on iris data
model <- train(iris_train, iris_lab, method = 'rf')

# Create an explainer object
explainer <- lime(iris_train, model)

# Explain new observation
explanation <- explain(iris_test, explainer, n_labels = 1, n_features = 4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants