You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that DiceRandom encounters errors, but is feature_weight not required for random-based? That's my understanding. However, for gradient-based methods, there is a custom feature_weight functionality implemented, which should be sufficient. Thank you.
When running the below code in DICE_with_advanced_option.ipynb, it dumps due to the the below error:
code:
generate counterfactuals
dice_exp = exp.generate_counterfactuals(query_instance, total_CFs=4, desired_class="opposite",
feature_weights=feature_weights)
error:
TypeError Traceback (most recent call last)
Cell In[18], line 2
1 # generate counterfactuals
----> 2 dice_exp = exp.generate_counterfactuals(query_instance, total_CFs=4, desired_class="opposite",
3 feature_weights=feature_weights)
..\dice_ml\explainer_interfaces\explainer_base.py:161, in ExplainerBase.generate_counterfactuals(self, query_instances, total_CFs, desired_class, desired_range, permitted_range, features_to_vary, stopping_threshold, posthoc_sparsity_param, proximity_weight, sparsity_weight, diversity_weight, categorical_penalty, posthoc_sparsity_algorithm, verbose, **kwargs)
159 for query_instance in tqdm(query_instances_list):
160 self.data_interface.set_continuous_feature_indexes(query_instance)
--> 161 res = self._generate_counterfactuals(
162 query_instance, total_CFs,
163 desired_class=desired_class,
164 desired_range=desired_range,
165 permitted_range=permitted_range,
166 features_to_vary=features_to_vary,
167 stopping_threshold=stopping_threshold,
168 posthoc_sparsity_param=posthoc_sparsity_param,
169 posthoc_sparsity_algorithm=posthoc_sparsity_algorithm,
170 verbose=verbose,
171 **kwargs)
172 cf_examples_arr.append(res)
173 self._check_any_counterfactuals_computed(cf_examples_arr=cf_examples_arr)
TypeError: _generate_counterfactuals() got an unexpected keyword argument 'feature_weights'
The text was updated successfully, but these errors were encountered: