anchor
anchor copied to clipboard
'AnchorTabularExplainer' object has no attribute 'validation'
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'
Experiencing the same issue.


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.
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)



The above issue was happening since my data was a DataFrame. After changing it to a numpy array, all worked correctly. Thanks.