{ "info": { "author": "Skander Kamoun", "author_email": "skander.kam2@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=========\ntrelawney\n=========\n\n\n.. image:: https://img.shields.io/pypi/v/trelawney.svg\n :target: https://pypi.python.org/pypi/trelawney\n\n.. image:: https://img.shields.io/travis/skanderkam/trelawney.svg\n :target: https://travis-ci.org/skanderkam/trelawney\n\n.. image:: https://readthedocs.org/projects/trelawney/badge/?version=latest\n :target: https://trelawney.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/github/license/skanderkam/trelawney\n :alt: MIT License\n\n\n\nTrelawney is a general interpretability package that aims at providing a common api to use most of the modern\ninterpretability methods to shed light on sklearn compatible models (support for Keras and XGBoost are tested).\n\nTrelawney will try to provide you with two kind of explanation when possible:\n\n- global explanation of the model that highlights the most importance features the model uses to make its\n predictions globally\n- local explanation of the model that will try to shed light on why a specific model made a specific prediction\n\nThe Trelawney package is build around:\n\n- some model specific explainers that use the inner workings of some types of models to explain them:\n - `LogRegExplainer` that uses the weights of the your logistic regression to produce global and local explanations of\n your model\n - `TreeExplainer` that uses the path of your tree (single tree model only) to produce explanations of the model\n\n- Some model agnostic explainers that should work with all models:\n - `LimeExplainer` that uses the Lime_ package to create local explanations only (the local nature of Lime prohibits\n it from generating global explanations of a model\n - `ShapExplainer` that uses the SHAP_ package to create local and global explanations of your model\n - `SurrogateExplainer` that creates a general surogate of your model (fitted on the output of your model) using an\n explainable model (`DecisionTreeClassifier`,`LogisticRegression` for now). The explainer will then use the\n internals of the surrogate model to explain your black box model as well as informing you on how well the surrogate\n model explains the black box one\n\nQuick Tutorial (30s to Trelawney):\n----------------------------------\n\nHere is an example of how to use a Trelawney explainer\n\n>>> model = LogisticRegression().fit(X, y)\n>>> # creating and fiting the explainer\n>>> explainer = ShapExplainer()\n>>> explainer.fit(model, X, y)\n>>> # explaining observation\n>>> explanation = explainer.explain_local(X_expain)\n[\n {'var_1': 0.1, 'var_2': -0.07, ...},\n ...\n {'var_1': 0.23, 'var_2': -0.15, ...} ,\n]\n>>> explanation = explainer.graph_local_explanation(X_expain.iloc[:1, :])\n\n.. image:: http://drive.google.com/uc?export=view&id=1a1kdH8mjGdKiiF_JHR56L2-JeaRStwr2\n :width: 400\n :alt: Local Explanation Graph\n\n>>> explanation = explainer.feature_importance(X_expain)\n{'var_1': 0.5, 'var_2': 0.2, ...} ,\n>>> explanation = explainer.graph_feature_importance(X_expain)\n\n\n.. image:: http://drive.google.com/uc?export=view&id=1R2NFEU0bcZYpeiFsLZDKYfPkjHz-cHJ_\n :width: 400\n :alt: Local Explanation Graph\n\nFAQ\n---\n\n Why should I use Trelawney rather than Lime_ and SHAP_\n\nwhile you can definitally use the Lime and SHAP packages directly (they will give you more control over how to use their\npackages), they are very specialized packages with different APIs, graphs and vocabulary. Trelawnaey offers you a\nunified API, representation and vocabulary for all state of the art explanation methods so that you don't lose time\nadapting to each new method but just change a class and Trelawney will adapt to you.\n\nComming Soon\n------------\n\n* Regressor Support (PR welcome)\n* Image and text Support (PR welcome)\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _SHAP: https://github.com/slundberg/shap\n.. _Lime: https://github.com/marcotcr/lime\n\n\n=======\nHistory\n=======\n\n0.1.0 (2019-10-02)\n------------------\n\n* First release on PyPI.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/skanderkam/trelawney", "keywords": "trelawney", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "trelawney", "package_url": "https://pypi.org/project/trelawney/", "platform": "", "project_url": "https://pypi.org/project/trelawney/", "project_urls": { "Homepage": "https://github.com/skanderkam/trelawney" }, "release_url": "https://pypi.org/project/trelawney/0.2.0/", "requires_dist": null, "requires_python": ">=3.5, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "summary": "Generic Interpretability package", "version": "0.2.0" }, "last_serial": 5960144, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "3b9145ad9563de7ed7889f4beef8db74", "sha256": "e86613de138a5a92689862d7306f20dc7cca11ccece839d253a04044753489e8" }, "downloads": -1, "filename": "trelawney-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3b9145ad9563de7ed7889f4beef8db74", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 99837, "upload_time": "2019-10-11T12:48:54", "url": "https://files.pythonhosted.org/packages/e9/2b/1ab73b3fd98906e40772796f6e508a4b48c5295f37277869e57ddc915f09/trelawney-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6ea2f0038df4205b31d47b3fb74387f8", "sha256": "aa31803f25c7bfc5e904a841be62d76f652c42acca4c11c875325291e5023f25" }, "downloads": -1, "filename": "trelawney-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6ea2f0038df4205b31d47b3fb74387f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 99820, "upload_time": "2019-10-11T12:48:56", "url": "https://files.pythonhosted.org/packages/2a/f1/6aa483cef343ebfdc2dcca50a15ea63b3204d8fd4f248d2e5560fb835648/trelawney-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6ea2f0038df4205b31d47b3fb74387f8", "sha256": "aa31803f25c7bfc5e904a841be62d76f652c42acca4c11c875325291e5023f25" }, "downloads": -1, "filename": "trelawney-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6ea2f0038df4205b31d47b3fb74387f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 99820, "upload_time": "2019-10-11T12:48:56", "url": "https://files.pythonhosted.org/packages/2a/f1/6aa483cef343ebfdc2dcca50a15ea63b3204d8fd4f248d2e5560fb835648/trelawney-0.2.0.tar.gz" } ] }