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

'AnchorTabularExplainer' object has no attribute 'validation' #48

Open
ArpitSisodia opened this issue May 21, 2020 · 4 comments
Open

'AnchorTabularExplainer' object has no attribute 'validation' #48

ArpitSisodia opened this issue May 21, 2020 · 4 comments

Comments

@ArpitSisodia
Copy link

exp = explainer.explain_instance(numpy_test, catBoostModel.predict, threshold=0.95).

/opt/anaconda3/lib/python3.7/site-packages/anchor/anchor_tabular.py in sample_from_train(self, conditions_eq, conditions_neq, conditions_geq, conditions_leq, num_samples, validation)
98 bla
99 """
--> 100 train = self.train if not validation else self.validation
101 d_train = self.d_train if not validation else self.d_validation
102 idx = np.random.choice(range(train.shape[0]), num_samples,

AttributeError: 'AnchorTabularExplainer' object has no attribute 'validation'

@laramdemajo
Copy link

laramdemajo commented May 21, 2020

Experiencing the same issue.

Screen Shot 2020-05-22 at 00 39 26

Screen Shot 2020-05-22 at 00 44 17

@marcotcr
Copy link
Owner

Can you check your package version? Those lines of code should not be in there in 0.0.1.0, which is what is on pypi and in the master of this repo.

@laramdemajo
Copy link

When I run pip install anchor_exp, v0.0.0.6 is installed. After running pip install --upgrade anchor_exp I did get v0.0.1.0.

However with this new version I am now getting a new error which I was not getting before for the below code:
explainer = anchor_tabular.AnchorTabularExplainer(['Bad', 'Good'], dfTrain.columns, dfTrain)

Screen Shot 2020-05-23 at 00 18 40

Screen Shot 2020-05-23 at 00 18 50

Screen Shot 2020-05-23 at 00 18 57

@laramdemajo
Copy link

The above issue was happening since my data was a DataFrame. After changing it to a numpy array, all worked correctly. 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

3 participants