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
using LIME with caret and method="nnet" #38
Comments
Posting the original mail for reference:
|
These are both good suggestions. Q1: This is an easy fix that I can do immediately |
Thanks, Thomas!. As for Q2 (above), Petal.Width <= 0.4 (0.7016) greenbar... These actual Case values visible in the plot, |
That is the most obvious choice - My main concern is that the text is already long as it is so I would prefer not to add a floating point number there as well... |
Q1 has been fixed in 84f82eb |
Thanks for fixing Q1, Thomas!. Hope you can still find How about showing the actual value of a variable, I don't know if that is possible, |
Lime R-pkg is great!
Thanks to your suggestions,
the code now works fine.
2 quick Questions
Q1:
Is there a way to make the
plot_features(explanation[1:8, ])
display the plot cases (15,18,25,7) in the same order
as the cases in the test.set (7,15,18,25...) ?
reason: it's easier to present results to the end User
if the case numbers are in the same order
as in the test.set file...
Q2:
Would it be possible
to include inside/next to each color plot bar,
the actual value of a column ?
(ie: next to condition:
Petal.Length <= 1.6
you would display the actual value for Case 7: 1.4)
reason: avoids User having to consult the test.set file for each Case in plot .
The tested value is right there, in the plot... :-)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Complete example code below :
inTrain <- createDataPartition(y=iris$Species, p=0.75, list=FALSE) # 75% for the train.set
train.set <- iris[inTrain,]
test.set <- iris[-inTrain,]
model <- train(Species ~ ., train.set, method='nnet', trace = FALSE, preProc = c("center", "scale"))
prediction <- predict(model, test.set[-5])
table(prediction, test.set$Species)
prediction <- predict(model, test.set[-5], type="prob")
now LIME!
Create an explainer object
explainer <- lime(train.set, model)
Explain new observation:
explanation <- explain(test.set[,-5], explainer, n_labels = 1, n_features = 2)
plot_features(explanation[1:8, ])
Thanks Thomas!!
The text was updated successfully, but these errors were encountered: