InterpretabilityOptions
Options & Configuration ยท AiDotNet.Models.Options
Configuration options for model interpretability and explainability features.
Inheritance: ModelOptions โ InterpretabilityOptions
For Beginners
These options control how your model explains its predictions.
Why interpretability matters:
- Understanding why a model makes certain predictions builds trust
- Identifying which features drive predictions helps validate model logic
- Explaining individual predictions is often required for regulatory compliance
- Finding biases in feature importance can reveal unfair model behavior
Available explanation methods:
Model-Agnostic Methods (work with any model):
- SHAP: Shows how each feature contributed to each prediction (local and global)
- LIME: Explains individual predictions using simple approximations
- Permutation Importance: Shows which features matter most overall
- Partial Dependence: Shows how features affect predictions on average
- Feature Interaction: Measures how features interact using H-statistic
- Counterfactual: Shows what would need to change for a different prediction
- Anchor: Creates rule-based explanations
- Global Surrogate: Trains a simple model to mimic the complex one
Neural Network Methods (require gradient access):
- Integrated Gradients: Theoretically-grounded attribution method
- DeepLIFT: Fast attribution comparing to baseline
- GradCAM: Visual heatmaps for CNN explanations
How It Works
This class configures which interpretability methods are available and how they behave. It supports multiple model-agnostic explanation techniques that work with any model, as well as specialized neural network explanation methods.
Constructors
| Constructor | Summary |
|---|---|
InterpretabilityOptions() |
Properties
| Property | Summary |
|---|---|
bool DeepLIFTUseRevealCancel { get; set; } |
Gets or sets whether to use the RevealCancel rule for DeepLIFT (default: Rescale). |
bool EnableAnchor { get; set; } |
Gets or sets whether Anchor explanations are enabled. |
bool EnableCounterfactual { get; set; } |
Gets or sets whether Counterfactual explanations are enabled. |
bool EnableDeepLIFT { get; set; } |
Gets or sets whether DeepLIFT is enabled for neural network explanation. |
bool EnableFeatureInteraction { get; set; } |
Gets or sets whether Feature Interaction analysis (H-statistic) is enabled. |
bool EnableGlobalSurrogate { get; set; } |
Gets or sets whether Global Surrogate modeling is enabled. |
bool EnableGradCAM { get; set; } |
Gets or sets whether GradCAM is enabled for CNN visual explanations. |
bool EnableIntegratedGradients { get; set; } |
Gets or sets whether Integrated Gradients is enabled for neural network explanation. |
bool EnableLIME { get; set; } |
Gets or sets whether LIME explanations are enabled. |
bool EnablePartialDependence { get; set; } |
Gets or sets whether Partial Dependence Plots (PDP) are enabled. |
bool EnablePermutationImportance { get; set; } |
Gets or sets whether Permutation Feature Importance is enabled. |
bool EnableSHAP { get; set; } |
Gets or sets whether SHAP explanations are enabled. |
bool EnableTreeSHAP { get; set; } |
Gets or sets whether TreeSHAP is enabled for tree-based model explanation. |
bool UseGradCAMPlusPlus { get; set; } |
Gets or sets whether to use GradCAM++ instead of standard GradCAM. |
double? LIMEKernelWidth { get; set; } |
Gets or sets the kernel width for LIME (controls locality). |
int IntegratedGradientsSteps { get; set; } |
Gets or sets the number of integration steps for Integrated Gradients. |
int LIMESampleCount { get; set; } |
Gets or sets the number of perturbed samples for LIME. |
int MaxBackgroundSamples { get; set; } |
Gets or sets the maximum number of background samples for SHAP baseline calculation. |
int PermutationRepeatCount { get; set; } |
Gets or sets the number of times to repeat permutation for more stable estimates. |
int SHAPSampleCount { get; set; } |
Gets or sets the number of samples to use for Kernel SHAP approximation. |
string[] FeatureNames { get; set; } |
Gets or sets optional feature names for more readable explanations. |