Contextualizing model's decisions with natural language explanations.
Project description
Project description
DSConteXAI is a Python package developed as part of the Data Science Project Competition 2024.
It links local explainability methods with natural language explanations, allowing users to gain detailed insights into model predictions. By incorporating additional domain knowledge, users can obtain even more detailed insights into the model's predictions.
Install
DSConteXAI can be installed using pip:
pip install dscontexai
Generate XAI reports
Using this package, you can fully automatically develop your XAI reports. Currently, it supports SHAP values, which is a local feature importance measure, to which we added textual explanations and domain-related context.
SHAP values can be calculated for a variety of models, including the most popular ensemble models: XGBoost, CatBoost, and Random Forest. To use this tool with your dataset, you need to provide a configuration JSON file for a dataset, structured like the one below.
{
# domain-based context
"optimal_values": [
...
[0, 6.5], # HbA1c level optimal range is from 0 to 6.5
[100, 140] # Glucose level optimal range is from 100 to 140
],
"descriptions": {
"below_optimal": [
# Context for feature values falling below the optimal range
],
"optimal": [
# Context for feature values falling within the optimal range
],
"above_optimal": [
# Context for feature values falling above the optimal range
]
},
# Data transformations for feature mapping
"transformation": {
"0": ["Man", "Woman"], # Transformation for Gender
"1": [], # No transformation for Age (numeric)
"2": ["No", "Yes"], # Transformation for Hypertension
...
},
"feature_names": [
"Gender",
"Age",
"Hypertension",
"Heart_disease",
"Smoking_history",
"BMI",
"HbA1c_level",
"Blood_glucose_level"
],
# variables needed for structuring the description
"target1": "diabetes", # Target variable the model is predicting
"target2": "Person", # The object representing a sample in a data
"supporting": ["does", "have"] # Supporting verbs used in descriptions
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dscontexai-0.1.1.tar.gz
.
File metadata
- Download URL: dscontexai-0.1.1.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bc5a195f873c20454282197b021255f42d961db7ddd9bde74ef364452819bd6 |
|
MD5 | 4892ca296c7d9ee11c73f0620d5e0453 |
|
BLAKE2b-256 | 111a34a67c4279df8b2aa76f6aec088914f1d2a96f165174b7f0a7db657cf8b7 |
File details
Details for the file dscontexai-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: dscontexai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a151a8bc36acfe55ee8700a2aaf67dc979afce109ea21364df267a46c41b60dc |
|
MD5 | f4535f645d963a5e5fa2c4b54f6f72a0 |
|
BLAKE2b-256 | f27bc08e8fbc1a66d8b9f9c2044961d6b96a110f1ed97139dbde6591dbecaffc |