{"id":19491922,"url":"https://github.com/neelsoumya/complex_stories_explanations","last_synced_at":"2026-06-19T14:32:28.243Z","repository":{"id":180072743,"uuid":"657073750","full_name":"neelsoumya/complex_stories_explanations","owner":"neelsoumya","description":"Complex stories as explanations for machine learning models","archived":false,"fork":false,"pushed_at":"2023-10-09T09:44:03.000Z","size":2421,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-18T14:34:37.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neelsoumya.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}},"created_at":"2023-06-22T09:01:36.000Z","updated_at":"2023-10-07T08:15:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7cc3894-33b9-4236-8b11-09ed07ccc68a","html_url":"https://github.com/neelsoumya/complex_stories_explanations","commit_stats":null,"previous_names":["neelsoumya/complex_stories_explanations"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/neelsoumya/complex_stories_explanations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelsoumya%2Fcomplex_stories_explanations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelsoumya%2Fcomplex_stories_explanations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelsoumya%2Fcomplex_stories_explanations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelsoumya%2Fcomplex_stories_explanations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neelsoumya","download_url":"https://codeload.github.com/neelsoumya/complex_stories_explanations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelsoumya%2Fcomplex_stories_explanations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34536275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-10T21:18:47.036Z","updated_at":"2026-06-19T14:32:28.226Z","avatar_url":"https://github.com/neelsoumya.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Class Contrastive Explanations and Generating Complex Stories from Machine Learning Models\n\nIn order to provide a better explanability for machine learning models in healthcare are, we provide an implementation for class contrastive analysis for Pima dataset.\n\nClass contrastive analysis is a technique to explain black-box machine learning models [1].\n\nIn addition to this approach, Mark W. Craven and Jude W. Shavlik proposed extracting Thee-Structured representations of trained networks in 1993.\n\nWe use the TREPAN implementation in \"Extracting tree-structured representations of trained networks\" : Craven,Shavlik 1993 from github user: @abarthakur.\n\nhttps://github.com/abarthakur/trepan_python\n\n\n# Quick Installation\n\nInstall Anaconda (Python distribution)\n\nand install all packages by running the following command at the Terminal\n\n```python\n\npip install -r requirements.txt\n\n```\n\n\n# Data\n\nDownload the data from\n\nhttps://www.kaggle.com/datasets/uciml/pima-indians-diabetes-database\n\n\n# Files\n\nThe script `simple_2D__pima_heatmap.ipynb` does the following things:\n\n1. Trains a simple 3-layer neural network on the pima dataset\n2. Provides Data centric explanation like outlier detection\n3. Provides double feature class contrastive analysis\n\n\nFigure 3.1 is generated in `pima_heatmap.ipynb`.\n\nFigure 4.1 is generated from `pima_heatmap.ipynb`.\n\nFigure 4.2 is generated from `2D_pima_heatmap.ipynb`.\n\nFigure 4.3 is generated from `3D_pima_heatmap.ipynb`.\n\nFigure 4.4 is generated from `4D_pima_heatmap.ipynb`.\n\nFigure 4.7 is generated from `2D_pima_heatmap.ipynb`.\n\nFigure 4.8 is generated from `opposite2D_pima_heatmap.ipynb`.\n\n\n\n# Manuscript and citation\n\nBanerjee S, Lio P, Jones PB, Cardinal RN (2021) A class-contrastive human-interpretable machine learning approach to predict mortality in severe mental illness. npj Schizophr 7: 1–13.\n\nhttps://www.nature.com/articles/s41537-021-00191-y\n\nGenerating complex explanations from machine learning models using class-contrastive reasoning\n\nhttps://www.medrxiv.org/content/10.1101/2023.10.06.23296591v1\n\n\n\n\n# Contact\n\nYujia Yang and Soumya Banerjee\n\nsb2333@cam.ac.uk\n\n\n# References\n\nIf you use this work, please cite the following paper:\n\n1. Banerjee S, Lio P, Jones PB, Cardinal RN (2021) A class-contrastive human-interpretable machine learning approach to predict mortality in severe mental illness. npj Schizophr 7: 1–13.\n\n  https://www.nature.com/articles/s41537-021-00191-y\n\n\n\n2. Yujia Yang, Soumya Banerjee, Generating complex explanations from machine learning models using class-contrastive reasoning\n\nhttps://www.medrxiv.org/content/10.1101/2023.10.06.23296591v1\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneelsoumya%2Fcomplex_stories_explanations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneelsoumya%2Fcomplex_stories_explanations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneelsoumya%2Fcomplex_stories_explanations/lists"}