Package: xautoml
XAutoML: A Visual Analytics Tool for Establishing Trust in Automated Machine LearningXAutoML is an interactive visual analytics tool for explaining AutoML optimisation procedures and ML pipelines
constructed by AutoML. It combines interactive visualizations with established techniques from explainable AI (XAI) to
make the complete AutoML procedure transparent and explainable. We integrate XAutoML with Jupyter to enable experienced
users to extend the visual analytics with advanced ad-hoc visualizations based on information extracted from XAutoML.Currently, XAutoML supports onlyauto-sklearndswizardFLAMLOptunascikit-learnbut we plan to add support for further AutoML systems. You can find a video introducing XAutoML onYouTube.Important:XAutoML requires JavaScript support. This implies that embedded Jupyter Notebooks in VS Code, PyCharm,
... may not work properly. Please use XAutoML in a browser for now.InstallCreate a new environment with python >= 3.7 and make sure swig is installed either on your system or inside the
environment.Install swigYou can either install swig via conda (conda install swig)Or follow theofficial documentationto install itTo install the extension, execute:pipinstallxautomlUsageXAutoML currently only works with JupyterLab. You can find ready to use Notebook examples in theexamplesfolder.cdexamples
jupyterlabTo use XAutoML, three steps are necessary:Perform an optimization in one of the supported AutoML frameworksImport theRunHistoryof the optimizer via the correspondingadapterCreate theXAutoMLvisualizationfromxautoml.mainimportXAutoMLfromxautoml.adapterimportimport_sklearnfromxautoml.util.datasetsimportopenml_taskfromsklearn.model_selectionimportRandomizedSearchCV# 1) Perform AutoML optimizationrandom_search=RandomizedSearchCV(...).fit(...)# 2) Use Adapter to create RunHistoryrh=import_sklearn(random_search)# 3) Create VisualizationX_test,y_test=openml_task(31,0,test=True)main=XAutoML(rh,X_test,y_test)main.explain()Checking Only Specific AspectsIf you want to see only specific information in XAutoML, you can include only specific visualizations. For example,
if you only want to validate the model behaviour, you can exclude all technical ML details by usingmain.explain(include={'overview','candidate:domain','ensemble'})Standalone VisualizationsInstead of rendering the complete visualization, only specific standalone views can be rendered. For example, if you
are only interested in checking the leaderboard, only it can be rendered usingmain.explain_leaderboard()For basically all views a stand-alone view is available. Check the documentation of the variousXAutoML().render_*(...)methods for more details.DockerXAutoML is also provided as a Docker container. The container is based on the popularJupyter Docker Stackscipy-notebook. It
contains a ready to use Jupyter Lab with the installed XAutoML extension. In addition, the/home/jovyan/automlcontains ready to use XAutoML examples for all supported AutoML libraries. To use the docker container, simply rundocker run -it -p 8888:8888 mz93/xautomlUninstallTo remove the extension, execute:pipuninstallxautomlTroubleshootIf you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:jupyterserverextensionlistIf the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:jupyterlabextensionlistIf the installation failed with the following exception[...]
    Running setup.py install for pyrfr ... error
    ERROR: Command errored out with exit status 1:
    [...]
    swig.exe -python -c++ -modern -py3 -features nondynamic -I./include -o pyrfr/regression_wrap.cpp pyrfr/regression.i
    error: command 'swig.exe' failed: No such file or directory
[...]verify that you have swig installed (seeInstallationabove).ContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the xautoml directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Server extension must be manually installed in develop modejupyterserverextensionenablexautoml# Rebuild extension Typescript source after making changesjlpminstall
jlpmrunbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm run buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseDevelopment uninstall# Server extension must be manually disabled in develop modejupyterserverextensiondisablexautoml
pipuninstallxautomlIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedxautomlwithin that folder.Release new versionIncrease version number inpackage.jsonand upload the latest build to pypi.pipinstallbuild
python-mbuild-s
python-mtwineuploaddist/*CitationIf you are usingXAutoML, please cite it as@article{Zoller2022,
    author = "Z{\"{o}}ller, Marc-Andr{\'{e}} and Titov, Waldemar and Schlegel, Thomas and Huber, Marco F.",
    title = "{XAutoML: A Visual Analytics Tool for Establishing Trust in Automated Machine Learning}",
    journal = "arXiv preprint arXiv: 2202.11954",
    volume = "1",
    year = "2022",
    pages = "1-34",
    url = "http://arxiv.org/abs/2202.11954",
    eprint = "2202.11954",
    archivePrefix = "arXiv",
    arxivId = "2202.11954"
}