dice_ml package¶
Subpackages¶
- dice_ml.data_interfaces package
- dice_ml.explainer_interfaces package
- Submodules
- dice_ml.explainer_interfaces.dice_KD module
- dice_ml.explainer_interfaces.dice_genetic module
- dice_ml.explainer_interfaces.dice_pytorch module
- dice_ml.explainer_interfaces.dice_random module
- dice_ml.explainer_interfaces.dice_tensorflow1 module
- dice_ml.explainer_interfaces.dice_tensorflow2 module
- dice_ml.explainer_interfaces.explainer_base module
- dice_ml.explainer_interfaces.feasible_base_vae module
- dice_ml.explainer_interfaces.feasible_model_approx module
- Module contents
- dice_ml.model_interfaces package
- dice_ml.utils package
Submodules¶
dice_ml.counterfactual_explanations module¶
-
class
dice_ml.counterfactual_explanations.
CounterfactualExplanations
(cf_examples_list, local_importance=None, summary_importance=None)[source]¶ Bases:
object
A class to store counterfactual examples for one or more inputs and feature importance scores.
- Parameters
cf_examples_list – A list of CounterfactualExamples instances
local_importance – List of estimated local importance scores. The
size of the list is the number of input instances, each containing feature importance scores for that input. :param summary_importance: Estimated global feature importance scores based on the input set of CounterfactualExamples instances
-
property
cf_examples_list
¶
-
property
local_importance
¶
-
property
metadata
¶
-
property
summary_importance
¶
dice_ml.data module¶
Module pointing to different implementations of Data class
DiCE requires only few parameters about the data such as the range of continuous features and the levels of categorical features. Hence, DiCE can be used for a private data whose meta data are only available (such as the feature names and range/levels of different features) by specifying appropriate parameters.
dice_ml.dice module¶
Module pointing to different implementations of DiCE based on different frameworks such as Tensorflow or PyTorch or sklearn, and different methods such as RandomSampling, DiCEKD or DiCEGenetic
dice_ml.diverse_counterfactuals module¶
-
class
dice_ml.diverse_counterfactuals.
CounterfactualExamples
(data_interface=None, final_cfs_df=None, test_instance_df=None, final_cfs_df_sparse=None, posthoc_sparsity_param=0, desired_range=None, desired_class='opposite', model_type='classifier')[source]¶ Bases:
object
A class to store and visualize the resulting counterfactual explanations.
dice_ml.model module¶
Module pointing to different implementations of Model class
The implementations contain methods to access the output or gradients of ML models trained based on different frameworks such as Tensorflow or PyTorch.