Data analysis
Surface imbalance across data and protected attributes, then correct it before training.
OPEN SOURCE · ALPHA · MIT
"XAI is a Machine Learning library that is designed with AI explainability in its core." It implements the three steps of explainable machine learning: data analysis, model evaluation and production monitoring, tools and process together.
01 — THE PROCESS, BY CHECKPOINT
XAI converts the Responsible AI Principles into a practical tool + process approach. The process carries explainability and bias mitigation through the full responsible-ML workflow, rather than treating them as a one-off report after training.
TOOL + PROCESS
Inspect the data before training
Surface imbalance across data and protected attributes, then correct it before training.
Explain model behaviour and compare outcomes across protected groups.
Monitor predictions, surface bias and feed findings back into mitigation.
02 — THE TOOLBOX, BY STAGE
The library ships with a census dataset for experimentation (xai.data.load_census()), and installs from PyPI. The protected-attribute lens runs through every stage: the same gender or ethnicity split that shapes the train/test split reappears in the metric and ROC comparisons.
STAGE 01 — PUBLIC API
imbalance_plot+Plot class imbalances across one or more columns.

balance+Correct class imbalances with up-sampling or down-sampling.
correlations+Visualise correlations as a matrix or hierarchical dendogram.
group_by_columns+Group a dataset by one or more categorical columns for custom operations.
balanced_train_test_split+Create train and test splits balanced across protected attributes.
STAGE 02 — PUBLIC API
feature_importance+Calculate permutation-based feature importance.
metrics_plot+Compare metric imbalances overall and across protected columns.

roc_plot+Plot ROC curves overall or per group, such as gender, ethnicity, or age.
confusion_matrix_plot+Render a confusion matrix for model predictions.
STAGE 03 — PUBLIC API
smile_imbalance+Bucket accuracy and statistical metrics by prediction probability to visualise benefits of adding manual review on probability thresholds.

03 — TALK AND WORKED EXAMPLE
The approach was presented at PyData London, covering how to identify and mitigate undesired bias with the toolbox.
PYDATA LONDON 2019 · VIDEOExplainable AI and bias mitigation with the XAI LibraryWatch the talk