Case explainability
Using the below command displays a list of cases. The list allows you to apply filters using tags and search for a particular case by using its unique identifier.
Users can view a case by providing at least one component from the list, such as feature importance, policies, or similar cases. To retrieve all components at once, pass "all" in the component list.
SHAP Feature Importance: To retrieve the SHAP feature importance for a given case, use the following code:
Integrated Gradients Feature Importance: To retrieve the Integrated Gradients feature importance for the case, use the following code:
DLBacktrace Feature Importance: Developed by AryaXAI, offers a new approach to interpreting deep learning models of any modality and size by meticulously tracing relevance from model decisions to their inputs. To get feature importance for a case using DLB, use the following function:
To invoke the Case View through Gova servers, pass the instance type as a parameter—for example: instance_type = "gova-2".
Users can retrieve the feature importance value for a specific feature by passing the feature name as a parameter to the following function:
Audit
The Audit tab in the case view provides key insights into model behavior and system alerts associated with the selected case. The overview includes:
- Model Snapshot: Displays the model information as it was at the time the case was processed
- Recent Alerts: Lists any alerts triggered for this case within the past 7 days, helping users identify anomalies or issues related to model performance, data quality, or policy violations.
To retrieve alerts from the past 7 days, use the Alerts Trail function as shown below. It will return only the relevant results within that time frame.
To view alerts triggered within a specific time frame, pass the desired number of days as a parameter to the following function:
Activating Inference for an Inactive Model:
When the XGBoost default model is active, you can still access cases associated with an inactive model by first activating inference for the desired model. Use the following function to activate the inference:
Retrieving Case Details for a Specific Model:
Once inference for the specified model is activated, you can retrieve the case details by using the case_info function. Use the following function:
Feature Importance
Case Feature Importance - Retrieve and analyze feature importance for a given case using SHAP or LIME.
Raw Data and Engineered Data
In AryaXAI, there is a convenient feature that allows users to segregate raw data and engineered data. This feature provides an easy way to switch between viewing and working with the original raw data and the processed engineered data, since your model is trained on the engineered data.
To fetch Raw Data of all features for a particular case via SDK, use the following prompt:
Uploading feature mapping:
To upload a feature mapping file in JSON format, use the upload_feature_mapping function. This function allows you to map features for your model directly from a JSON file.
Observations
Observations executed for Case
Policies which are executed for Case
Running a new case
Retrieve logs
You can set up ML Explainability and rerun the inferencing from time to time. You can see all the inferencing logs here.
Get all cases which are already viewed
To fetch Explainability for a case. This will use the current 'active' model. To call for the explainability, you can pass the UID and the tag.
Help function on method case info:
To fetch the Case Prediction Path:
Similar cases as explanations
'Similar cases,' also known as reference explanations, parallels the concept of citing references for a prediction. This method extracts the most similar cases from the training data compared to the 'prediction case.' The similarity algorithm employed depends on the plan. In the AryaXAI Developer version, the 'prediction probability' similarity method is used, while the AryaXAI Enterprise version offers additional methods such as 'Feature Importance Similarity' and 'Data Similarity.'
To list all Similar Cases wrt a particular case use the following function:
Get data of the similar cases via SDK: