Package: xaiographs
XAIoGraphsXAIoGraphs (eXplainabilityArticicialIntelligenceoverGraphs) is an Explicability and Fairness
Python library for classification problems with tabulated and discretized data.The explainability methods in this library don't make any hypotheses about the data, so it does not require the AI model.
Simply need data and predictions (or decisions), being able to explain AI models, rule models, and reality.This library includes the following functionalities:Global Explainability: Explains predictions or decisions as a whole, focusing on the variables that have the most influence.Local Explainability: Explains the prediction of a single element.Reliability Measureof local explainability.Reason Why:explanation in natural languageof the classification of each element.Fairness Scoring: highlights potential discriminations in classifications based on sensitive features.To understand orinterpret the explanationsusesXAIoWeb, aweb interfacerunning in local mode (127.0.0.1:8080).
It displays the explanations' outcomes in three sections: Global, Local and Fairness.🚀 Quickstart🔨 Installation XAIoGraphsCreate a virtual environment using conda for easier management of dependencies and packages.
For installing conda, follow the instructions on theofficial conda website>>condacreate--namexaio_envpython=3.7>>condaactivatexaio_envUse a python version 3.7 or higherFrom PyPI repository>>pipinstallxaiographs📝 Start with your first exampleUse the following entry point to view an example run with the virtual environment enabled:>>titanic_exampleAlternatively, you may run the code below to view a full implementation of all XAIoGraphs functionalities:fromxaiographsimportExplainerfromxaiographsimportWhyfromxaiographsimportFairnessfromxaiographs.datasetsimportload_titanic_discretized,load_titanic_whyLANG='en'# LOAD DATASETS & SEMANTICSdf_titanic,feature_cols,target_cols,y_true,y_predict=load_titanic_discretized()df_values_semantics,df_target_values_semantics=load_titanic_why(language=LANG)# EXPLAINERexplainer=Explainer(importance_engine='LIDE',verbose=1)explainer.fit(df=df_titanic,feature_cols=feature_cols,target_cols=target_cols)# WHYwhy=Why(language=LANG,explainer=explainer,why_values_semantics=df_values_semantics,why_target_values_semantics=df_target_values_semantics,verbose=1)why.fit()# FAIRNESSf=Fairness(verbose=1)f.fit(df=df_titanic[feature_cols+[y_true]+[y_predict]],sensitive_cols=['gender','class','age'],target_col=y_true,predict_col=y_predict)Following execution, a folder called "xaioweb files" is created, which contains a set of '.json' files that will
be used to present the results in the XAIoWeb graphical interface.📊 Launching XAIoWebXAIoWeb is a local web interface that displays the outcomes of the explanations in three sections: Global, Local,
and Fairness. To launch the web (with the virtual environment enabled), run the following entry point:>>xaioweb-dxaioweb_files-oThis entry point takes the following parameters:-do--data[REQUIRED]: JSON files path-po--port[OPTIONAL]: Web server port. 8080 by default-oo--open[OPTIONAL]: Open web in browser-fo--force[OPTIONAL]: Force building the web from scratch, overwriting the existing one🤝 ContributorsXAIoGraphs has been developed byApplied AI & Privacyteam (Telefónica Innovación Digital - Chief Data Officer)Ricardo MoyaMatteo SalvatoriEnrique FernandezAlejandro Manuel ArranzManuel MartínMario VillaizanCesar GarcíaDavid CadenasAlejandra Maria AlonsoMiguel Angel MartínOriol Arnau📥  ContactContact with@Ricardo Moya