Package: explabox
"{Explore|Examine|Expose|Explain} your model with theexplabox!"StatusLatest releaseDevelopmentTheexplaboxaims to support data scientists and machine learning (ML) engineers in explaining, testing and documenting AI/ML models, developed in-house or acquired externally. Theexplaboxturns youringestibles(AI/ML model and/or dataset) intodigestibles(statistics, explanations or sensitivity insights)!Theexplaboxcan be used to:Explore: describe aspects of the model and data.Examine: calculate quantitative metrics on how the model performsExpose: see model sensitivity to random inputs (robustness), test model generalizability (robustness), and see the effect of adjustments of attributes in the inputs (e.g. swapping male pronouns for female pronouns;fairness), for the dataset as a whole (global) as well as for individual instances (local).Explain: use XAI methods for explaining the whole dataset (global), model behavior on the dataset (global), and specific predictions/decisions (local).A number of experiments in theexplaboxcan also be used to provide transparency and explanations to stakeholders, such as end-users or clients.:information_source: Theexplaboxcurrently only supports natural language text as a modality. In the future, we intend to extend to other modalities.© National Police Lab AI (NPAI), 2022Quick tourTheexplaboxis distributed onPyPI. To use the package with Python, install it (pip install explabox), import yourdataandmodeland wrap them in theExplabox:>>>fromexplaboximportimport_data,import_model>>>data=import_data('./drugsCom.zip',data_cols='review',label_cols='rating')>>>model=import_model('model.onnx',label_map={0:'negative',1:'neutral',2:'positive'})>>>fromexplaboximportExplabox>>>box=Explabox(data=data,...model=model,...splits={'train':'drugsComTrain.tsv','test':'drugsComTest.tsv'})Then.explore,.examine,.exposeand.explainyour model:>>># Explore the descriptive statistics for each split>>>box.explore()>>># Show wrongly classified instances>>>box.examine.wrongly_classified()>>># Compare the performance on the test split before and after transforming all tokens to uppercase>>>box.expose.compare_metrics(split='test',perturbation='upper')>>># Get a local explanation (uses LIME by default)>>>box.explain.box.explain_prediction('Hate this medicine so much!')For more information, visit theexplabox documentation.ContentsQuick tourInstallationDocumentationExample usageReleasesContributingCitationInstallationThe easiest way to install the latest release of theexplaboxis throughpip:user@terminal:~$pipinstallexplaboxCollecting explabox...Installing collected packages: explaboxSuccessfully installed explabox:information_source: TheexplaboxrequiresPython 3.8or above.See thefull installation guidefor troubleshooting the installation and other installation methods.DocumentationDocumentation for theexplaboxis hosted externally onexplabox.rtfd.io.Example usageTheexample usage guideshowcases theexplaboxfor a black-box model performing multi-class classification of theUCI Drug Reviewsdataset.If you want to follow along, simplypip install explabox-demo-drugreviewand run the lines in theJupyter notebookwe have prepared for you!ReleasesTheexplaboxis officially released throughPyPI. Thechangelogincludes a full overview of the changes for each version.ContributingTheexplaboxis an open-source project developed and maintained primarily by the NetherlandsNational Police Lab AI(NPAI). However, your contributions and improvements are still required! Seecontributingfor a full contribution guide.Citation...