{"id":13704414,"url":"https://github.com/Telefonica/XAIoGraphs","last_synced_at":"2025-05-05T09:33:57.135Z","repository":{"id":171331012,"uuid":"516359931","full_name":"Telefonica/XAIoGraphs","owner":"Telefonica","description":"XAIoGraphs (eXplainability Articicial Intelligence over Graphs) is an Explicability and Fairness Python library for classification problems with tabulated and discretized data.","archived":false,"fork":false,"pushed_at":"2024-10-09T10:05:35.000Z","size":37291,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-13T05:07:24.534Z","etag":null,"topics":["artificial-intelligence","explainable-artificial-intelligence","fairness-ai","machine-learning"],"latest_commit_sha":null,"homepage":"https://xaiographs.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Telefonica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-21T12:21:25.000Z","updated_at":"2024-12-04T19:47:17.000Z","dependencies_parsed_at":"2023-12-09T16:26:07.032Z","dependency_job_id":"78a02d83-f4b1-426a-a8e8-4a4f7395cc1f","html_url":"https://github.com/Telefonica/XAIoGraphs","commit_stats":null,"previous_names":["telefonica/xaiographs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2FXAIoGraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2FXAIoGraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2FXAIoGraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2FXAIoGraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Telefonica","download_url":"https://codeload.github.com/Telefonica/XAIoGraphs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252471724,"owners_count":21753239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","explainable-artificial-intelligence","fairness-ai","machine-learning"],"created_at":"2024-08-02T21:01:09.075Z","updated_at":"2025-05-05T09:33:52.120Z","avatar_url":"https://github.com/Telefonica.png","language":"Python","readme":"# \u003cimg src=\"https://github.com/Telefonica/XAIoGraphs/blob/master/docs/imgs/icon.png?raw=True\" align=\"left\"/\u003e  XAIoGraphs\n\n![python versions](https://img.shields.io/badge/python-3.7%2C%203.8%2C%203.9-blue.svg)\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n\nXAIoGraphs (e**X**plainability **A**rticicial **I**ntelligence **o**ver **Graphs**) is an Explicability and Fairness \nPython library for classification problems with tabulated and discretized data.\n\nThe explainability methods in this library don't make any hypotheses about the data, so it does not require the AI model.\nSimply need data and predictions (or decisions), being able to explain AI models, rule models, and reality.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/Telefonica/XAIoGraphs/blob/master/docs/imgs/XAIoGraphs_schema.png?raw=True\" width=\"800px\" /\u003e\n\u003c/p\u003e\n\nThis library includes the following functionalities:\n\n+ **Global Explainability**: Explains predictions or decisions as a whole, focusing on the variables that have the most influence.\n+ **Local Explainability**: Explains the prediction of a single element.\n+ **Reliability Measure** of local explainability.\n+ **Reason Why:** *explanation in natural language* of the classification of each element.\n+ **Fairness Scoring**: highlights potential discriminations in classifications based on sensitive features.\n\nTo understand or ***interpret the explanations*** uses ***XAIoWeb***, a ***web interface*** running in local mode (127.0.0.1:8080). \nIt displays the explanations' outcomes in three sections: Global, Local and Fairness.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/Telefonica/XAIoGraphs/blob/master/docs/imgs/XAIoWeb.png?raw=True\" width=\"800px\" /\u003e\n\u003c/p\u003e\n\n\n# 🚀 Quickstart \n\n## 🔨 Installation XAIoGraphs\n\nCreate a virtual environment using conda for easier management of dependencies and packages. \nFor installing conda, follow the instructions on the [official conda website](https://docs.conda.io/projects/conda/en/latest/user-guide/install/)\n\n```python\n\u003e\u003e conda create --name xaio_env python=3.7\n\u003e\u003e conda activate xaio_env\n```\n\n```{warning} \nUse a python version 3.7 or higher\n```\n\n\n**From PyPI repository** \n```python\n\u003e\u003e pip install xaiographs\n```\n\n\n## 📝 Start with your first example\n\nUse the following entry point to view an example run with the virtual environment enabled:\n\n```python\n\u003e\u003e titanic_example\n```\n\nAlternatively, you may run the code below to view a full implementation of all XAIoGraphs functionalities:\n\n```python\nfrom xaiographs import Explainer\nfrom xaiographs import Why\nfrom xaiographs import Fairness\nfrom xaiographs.datasets import load_titanic_discretized, load_titanic_why\n\nLANG = 'en'\n\n# LOAD DATASETS \u0026 SEMANTICS\ndf_titanic, feature_cols, target_cols, y_true, y_predict = load_titanic_discretized()\ndf_values_semantics, df_target_values_semantics = load_titanic_why(language=LANG)\n\n# EXPLAINER\nexplainer = Explainer(importance_engine='LIDE', verbose=1)\nexplainer.fit(df=df_titanic, feature_cols=feature_cols, target_cols=target_cols)\n\n# WHY\nwhy = Why(language=LANG,\n          explainer=explainer,\n          why_values_semantics=df_values_semantics,\n          why_target_values_semantics=df_target_values_semantics,\n          verbose=1)\nwhy.fit()\n\n# FAIRNESS\nf = Fairness(verbose=1)\nf.fit(df=df_titanic[feature_cols + [y_true] + [y_predict]],\n      sensitive_cols=['gender', 'class', 'age'],\n      target_col=y_true,\n      predict_col=y_predict)\n```\n\nFollowing execution, a folder called \"xaioweb files\" is created, which contains a set of '.json' files that will \nbe used to present the results in the XAIoWeb graphical interface.\n\n## 📊 Launching XAIoWeb\n\nXAIoWeb is a local web interface that displays the outcomes of the explanations in three sections: Global, Local, \nand Fairness. To launch the web (with the virtual environment enabled), run the following entry point:\n\n```python\n\u003e\u003e xaioweb -d xaioweb_files -o\n```\n\nThis entry point takes the following parameters:\n\n- `-d` o `--data` [REQUIRED]: JSON files path\n- `-p` o `--port` [OPTIONAL]: Web server port. 8080 by default\n- `-o` o `--open` [OPTIONAL]: Open web in browser\n- `-f` o `--force` [OPTIONAL]: Force building the web from scratch, overwriting the existing one\n\n\n\n\n# 🤝 Contributors\n\nXAIoGraphs has been developed by ***Applied AI \u0026 Privacy*** team (Telefónica Innovación Digital - Chief Data Officer)\n\n* [Ricardo Moya](https://www.linkedin.com/in/phdricardomoya/)\n* [Matteo Salvatori](https://github.com/matteo-salvatori)\n* [Enrique Fernandez](https://github.com/QuiqueFdez)\n* [Alejandro Manuel Arranz](https://github.com/cx02747)\n* [Manuel Martín](https://github.com/mmarmar)\n* [Mario Villaizan](https://github.com/mvvmvv)\n* [Cesar García](https://github.com/cesarggtid)\n* [David Cadenas](https://github.com/davidcadi)\n* [Alejandra Maria Alonso](https://www.linkedin.com/in/alejandraalonsodiaz/)\n* [Miguel Angel Martín](https://github.com/mamj-telefonica)\n* [Oriol Arnau](https://github.com/oarnau)\n\n\n\n\n# 📥  Contact\n\nContact with [@Ricardo Moya](https://www.linkedin.com/in/phdricardomoya/)\n","funding_links":[],"categories":["Tools"],"sub_categories":["Interpretability/Explicability"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTelefonica%2FXAIoGraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTelefonica%2FXAIoGraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTelefonica%2FXAIoGraphs/lists"}