def add_corrupt_feature(feature_name, clean_train, clean_test, dirty_train,
                        train_labels, test_labels, class_probs_dirty, class_probs_clean, fake_prefix='FAKE'):
    for class_ in set(train_labels):
      indices = get_random_indices(train_labels, class_, class_probs_clean[class_])
      for i in indices:
        clean_train[i] += ' %s%s%s' % (fake_prefix, feature_name, fake_prefix)
      indices = get_random_indices(train_labels, class_, class_probs_dirty[class_])
      for i in indices:
        dirty_train[i] += ' %s%s%s' % (fake_prefix, feature_name, fake_prefix)
      indices = get_random_indices(test_labels, class_, class_probs_clean[class_])
      for i in indices:
        clean_test[i] += ' %s%s%s' % (fake_prefix, feature_name, fake_prefix)
clean_train, clean_test, dirty_train will be corrupted
dataset/ETHPy150Open marcotcr/lime-experiments/generate_data_for_compare_classifiers.py/add_corrupt_feature