XAI in Python with dalex
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
In MI2DataLab we have built many tools for the exploration, explanation and visualization of machine learning models. The latest product is the dalex package for Python developed by Wojciech Kretowicz and Hubert Baniecki.
It is written from scratch reimplementation of the DALEX package for R with identical functionalities and underlying philosophy. All algorithms have been rewritten to the Python and interactive plots are available through the plotly module.
Installation of the package
The latest version of the dalex package can be installed from a pip. The installation is very simple.
pip install dalex
Example use
We are still working on documentation and examples, so any feedback and suggestion will be welcome. For now we have:
- Introduction to the dalex package: Titanic: tutorial and examples.
- Code in the form of jupyter notebook — more to come.
- YouTube video showing how to do Break Down analysis in dalex.
All available functions are described in the open ebook Explanatory Model Analysis.
Why?
The R environment has a fantastic data visualization system. Once the pioneer of statistical graphics was its package graphics, then package lattice and now its ggplot2. No wonder that for R there are many great tools for visualizing machine learning models, like pdp, ALEplot, condvis, lime, DALEX, iml, ROCR, modelStudio, regtools, vip, auditor, arena, modelDown and many others.
But what if we have a model built in Python, for example in scikit-learn?
In MI2DataLab we have made several tools to visualize in R models built in Python like DALEXtra and pyDALEX. Each of them required installation of both R and Python, which pose a challenge when it comes to maintaining both environments. In order to make it easier to explain the models built in scikit-learn or other Python libraries, a DALEX clone for Python was created.
There are already many great tools for XAI in Python, such as ELI4, LIME, SHAP, XAI360, tf-explain or interpretml. The advantage of the dalex package is that it is based on the expandable grammar of Explanatory Model Analysis process.
If you have an idea for an extension or find an error, let us know. Post an issue on https://github.com/ModelOriented/DALEX/.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.