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

Maybe bug and solution: feature_select = "none" #141

Closed
ruizcrp opened this issue Jan 14, 2019 · 1 comment
Closed

Maybe bug and solution: feature_select = "none" #141

ruizcrp opened this issue Jan 14, 2019 · 1 comment

Comments

@ruizcrp
Copy link

ruizcrp commented Jan 14, 2019

Hello,

I am wondering, whether there might be a small bug linked to the selection of "none" for the attribute of feature_select.

In the file lime.R in the function select_features there is a select-clause that contains in line 96 the following code:
none = seq_len(nrow(x)),

It seems to me that this should read:
none = seq_len(ncol(x)),

Because the matrix that is given in (called "perm" in the code) contains in the rows the permutations and in the columns the variables.

And I guess that the code should say: take all the variables.

In the following way an error can be reproduced, because it will chose the number of permutations (which by standard is 5000) instead of the number of variables:

example(explain)
explain(iris_test, explanation, n_labels = 1, n_features=2,feature_select="none")

And here it works because n_permutations is set to 3 (so that the nrow(x) is below the number of variables in the iris dataset):
explain(iris_test, explanation, n_labels = 1,n_features=2,n_permutations=3,feature_select="none")

Kind regards!

@thomasp85
Copy link
Owner

Thanks

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