def measure_explanation_hability(self, explain_fn, max_examples=None):
    """Asks for explanations for all predictions in the train and test set, with
    budget = size of explanation. Returns two maps (train_results,
    test_results), from dataset to classifier to list of recalls"""
    budget = 10
    train_results = {}
    test_results = {}
    for d in self.train_data:
      train_results[d] = {}
      test_results[d] = {}
      print 'Dataset:', d
      for c in self.classifiers[d]:
        train_results[d][c] = []
        test_results[d][c] = []
        if c == 'l1logreg':
          c_features = self.classifiers[d][c].coef_.nonzero()[1]
        print 'classifier:', c 
        for i in range(len(self.test_data[d])):
          if c == 'l1logreg':
            true_features = set([x for x in self.test_vectors[d][i].nonzero()[1] if c_features in x])
          elif c == 'tree':
            true_features = get_tree_explanation(self.classifiers[d][c], self.test_vectors[d][i])
          if len(true_features) == 0:
            continue
          to_get = budget
          exp_features = set(map(lambda x:x[0],
          explain_fn(self.test_vectors[d][i], self.test_labels[d][i] ,self.classifiers[d][c], to_get, d)))
          test_results[d][c].append(float(len(true_features.intersection(exp_features))) / len(true_features))
          if max_examples and i >= max_examples:
            break
    return train_results, test_results
dataset/ETHPy150Open marcotcr/lime-experiments/evaluate_explanations.py/ExplanationEvaluator.measure_explanation_hability/swapped operands of `in`