{"id":13426200,"url":"https://github.com/marcotcr/lime","last_synced_at":"2026-10-18T22:07:58.829Z","repository":{"id":37385029,"uuid":"53982546","full_name":"marcotcr/lime","owner":"marcotcr","description":"Lime: Explaining the predictions of any machine learning classifier","archived":false,"fork":false,"pushed_at":"2024-07-25T20:32:21.000Z","size":21112,"stargazers_count":12167,"open_issues_count":134,"forks_count":1847,"subscribers_count":259,"default_branch":"master","last_synced_at":"2026-10-14T21:56:43.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcotcr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"citation.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-15T22:18:10.000Z","updated_at":"2026-10-13T23:37:02.000Z","dependencies_parsed_at":"2022-07-11T13:54:25.589Z","dependency_job_id":"d83d9226-0fd6-4627-afc6-799a8b1ae58d","html_url":"https://github.com/marcotcr/lime","commit_stats":{"total_commits":427,"total_committers":62,"mean_commits":6.887096774193548,"dds":0.6604215456674474,"last_synced_commit":"fd7eb2e6f760619c29fca0187c07b82157601b32"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/marcotcr/lime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcotcr%2Flime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcotcr%2Flime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcotcr%2Flime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcotcr%2Flime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcotcr","download_url":"https://codeload.github.com/marcotcr/lime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcotcr%2Flime/sbom","scorecard":{"id":618432,"data":{"date":"2025-08-11","repo":{"name":"github.com/marcotcr/lime","commit":"fd7eb2e6f760619c29fca0187c07b82157601b32"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":4,"reason":"Found 8/17 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T04:35:33.919Z","repository_id":37385029,"created_at":"2025-08-21T04:35:33.919Z","updated_at":"2025-08-21T04:35:33.919Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344794859,"owners_count":38329519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-14T02:00:06.392Z","response_time":82,"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-07-31T00:01:28.786Z","updated_at":"2026-10-18T22:07:57.019Z","avatar_url":"https://github.com/marcotcr.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Interpretability Toolboxes","Tools","Learning","Model Explanation","Explainability","Machine Learning","Python Libraries(sort in alphabeta order)","Explaining Black Box Models and Datasets","Uncategorized","📦 Legacy \u0026 Inactive Projects","Table of Contents","Explainability and counterfactuals","Libraries and repositories","模型的可解释性","Explainability and Fairness","Explainable Sentiment Analysis","AI Safety \u0026 Ethics","Explainable AI (XAI)","Python","AI Safety Tools","Explaining Model","🏠 Explainable AI Library","The Data Science Toolbox","Research \u0026 Data Analysis","Other","Main Contents","Exploration","The List of AI Testing Tools","Libraries (Python)","**Programming (learning)**","Tools and Libraries","🛡️ AI Safety, Ethics \u0026 Governance","Interpretability and Explainability","Model Interpretability"],"sub_categories":["Interpretability Framework","Others","Model Explainability and Interpretability","Evaluation methods","Uncategorized","Python packages","Post-hoc explanations","Methods \u0026 Tools","AI Safety Tools","General-Purpose Machine Learning","Open Source Tools","Vector Database","Subtask Scheduling with Human Annotation","Miscellaneous Tools","NLP","Mathematics","Explaining Predictions","13. LIME (Local Interpretable Model-agnostic Explanations)","**Developer\\'s Tools**","Responsible AI Resources","Actor-Critic Methods"],"readme":"# lime\n\n[![Build Status](https://travis-ci.org/marcotcr/lime.svg?branch=master)](https://travis-ci.org/marcotcr/lime)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/marcotcr/lime/master)\n\nThis project is about explaining what machine learning classifiers (or models) are doing.\nAt the moment, we support explaining individual predictions for text classifiers or classifiers that act on tables (numpy arrays of numerical or categorical data) or images, with a package called lime (short for local interpretable model-agnostic explanations).\nLime is based on the work presented in [this paper](https://arxiv.org/abs/1602.04938) ([bibtex here for citation](https://github.com/marcotcr/lime/blob/master/citation.bib)). Here is a link to the promo video:\n\n\u003ca href=\"https://www.youtube.com/watch?v=hUnRCxnydCc\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/marcotcr/lime/master/doc/images/video_screenshot.png\" width=\"450\" alt=\"KDD promo video\"/\u003e\u003c/a\u003e\n\nOur plan is to add more packages that help users understand and interact meaningfully with machine learning.\n\nLime is able to explain any black box classifier, with two or more classes. All we require is that the classifier implements a function that takes in raw text or a numpy array and outputs a probability for each class. Support for scikit-learn classifiers is built-in.\n\n## Installation\n\nThe lime package is on [PyPI](https://pypi.python.org/pypi/lime). Simply run:\n\n```sh\npip install lime\n```\n\nOr clone the repository and run:\n\n```sh\npip install .\n```\n\nWe dropped python2 support in `0.2.0`, `0.1.1.37` was the last version before that.\n\n## Screenshots\n\nBelow are some screenshots of lime explanations. These are generated in html, and can be easily produced and embedded in ipython notebooks. We also support visualizations using matplotlib, although they don't look as nice as these ones.\n\n#### Two class case, text\n\nNegative (blue) words indicate atheism, while positive (orange) words indicate christian. The way to interpret the weights by applying them to the prediction probabilities. For example, if we remove the words Host and NNTP from the document, we expect the classifier to predict atheism with probability 0.58 - 0.14 - 0.11 = 0.31.\n\n![twoclass](doc/images/twoclass.png)\n\n#### Multiclass case\n\n![multiclass](doc/images/multiclass.png)\n\n#### Tabular data\n\n![tabular](doc/images/tabular.png)\n\n#### Images (explaining prediction of 'Cat' in pros and cons)\n\n\u003cimg src=\"https://raw.githubusercontent.com/marcotcr/lime/master/doc/images/images.png\" width=200 /\u003e\n\n## Tutorials and API\n\nFor example usage for text classifiers, take a look at the following two tutorials (generated from ipython notebooks):\n\n- [Basic usage, two class. We explain random forest classifiers.](https://marcotcr.github.io/lime/tutorials/Lime%20-%20basic%20usage%2C%20two%20class%20case.html)\n- [Multiclass case](https://marcotcr.github.io/lime/tutorials/Lime%20-%20multiclass.html)\n\nFor classifiers that use numerical or categorical data, take a look at the following tutorial (this is newer, so please let me know if you find something wrong):\n\n- [Tabular data](https://marcotcr.github.io/lime/tutorials/Tutorial%20-%20continuous%20and%20categorical%20features.html)\n- [Tabular data with H2O models](https://marcotcr.github.io/lime/tutorials/Tutorial_H2O_continuous_and_cat.html)\n- [Latin Hypercube Sampling](doc/notebooks/Latin%20Hypercube%20Sampling.ipynb)\n\nFor image classifiers:\n\n- [Images - basic](https://marcotcr.github.io/lime/tutorials/Tutorial%20-%20images.html)\n- [Images - Faces](https://github.com/marcotcr/lime/blob/master/doc/notebooks/Tutorial%20-%20Faces%20and%20GradBoost.ipynb)\n- [Images with Keras](https://github.com/marcotcr/lime/blob/master/doc/notebooks/Tutorial%20-%20Image%20Classification%20Keras.ipynb)\n- [MNIST with random forests](https://github.com/marcotcr/lime/blob/master/doc/notebooks/Tutorial%20-%20MNIST%20and%20RF.ipynb)\n- [Images with PyTorch](https://github.com/marcotcr/lime/blob/master/doc/notebooks/Tutorial%20-%20images%20-%20Pytorch.ipynb)\n\nFor regression:\n\n- [Simple regression](https://marcotcr.github.io/lime/tutorials/Using%2Blime%2Bfor%2Bregression.html)\n\nSubmodular Pick:\n\n- [Submodular Pick](https://github.com/marcotcr/lime/tree/master/doc/notebooks/Submodular%20Pick%20examples.ipynb)\n\nThe raw (non-html) notebooks for these tutorials are available [here](https://github.com/marcotcr/lime/tree/master/doc/notebooks).\n\nThe API reference is available [here](https://lime-ml.readthedocs.io/en/latest/).\n\n## What are explanations?\n\nIntuitively, an explanation is a local linear approximation of the model's behaviour.\nWhile the model may be very complex globally, it is easier to approximate it around the vicinity of a particular instance.\nWhile treating the model as a black box, we perturb the instance we want to explain and learn a sparse linear model around it, as an explanation.\nThe figure below illustrates the intuition for this procedure. The model's decision function is represented by the blue/pink background, and is clearly nonlinear.\nThe bright red cross is the instance being explained (let's call it X).\nWe sample instances around X, and weight them according to their proximity to X (weight here is indicated by size).\nWe then learn a linear model (dashed line) that approximates the model well in the vicinity of X, but not necessarily globally. For more information, [read our paper](https://arxiv.org/abs/1602.04938), or take a look at [this blog post](https://www.oreilly.com/learning/introduction-to-local-interpretable-model-agnostic-explanations-lime).\n\n\u003cimg src=\"https://raw.githubusercontent.com/marcotcr/lime/master/doc/images/lime.png\" width=300px /\u003e\n\n## Contributing\n\nPlease read [this](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcotcr%2Flime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcotcr%2Flime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcotcr%2Flime/lists"}