An explainer for Chemprop based on LIME and PathExplain.
Project description
Chemexp
A Chemprop explainer based on LIME and PathExplain.
Installation
- Make sure your Python version is >= 3.8
conda
is required for ChemProp. If it is not installed on your machine, you can take a look at miniconda
- Install Chemprop
- Then simply run
pip install chemexp
- You're good to go!
Explanation
Using Python
import chemexp
from chemprop.utils import load_checkpoint
model = chemexp.ExplanationModel(load_checkpoint("models/fusion_db_1.pt"))
exp = model.explain_molecule("COC(=N)Cc1ccccc1")
chemexp.exp_to_png(exp, "mol.png")
A little more detail is available in test/test.py.
Web interface
Although you can use this Python module in your scripts, you can also experiment a user-friendly interface.
⚠️ Warning: this only works on Linux for the moment (this is due to the linux-specific paths used to save some files, but it can be adapted for Windows or Mac).
Use the following command to run the web server:
python -m chemexp <path>
where path
is a folder containing chemprop models / checkpoints (.pt files)
Authors
- BELLANGER Clément
- BERNIER Fabien
- MAIGRET Bernard
- NAPOLI Amedeo
To cite our work:
@mastersthesis{bernier:hal-03371070,
TITLE = {{A Study about Explainability and Fairness in Machine Learning and Knowledge Discovery}},
AUTHOR = {Bernier, Fabien},
URL = {https://hal.inria.fr/hal-03371070},
PAGES = {58},
SCHOOL = {{TELECOM Nancy}},
YEAR = {2021},
MONTH = Sep,
KEYWORDS = {machine learning ; explainability ; fairness ; antibiotic classification ; machine learning ; explicabilit{\'e} ; fairness ; classification antibiotique},
PDF = {https://hal.inria.fr/hal-03371070/file/M_moire_ing_nieur_Fabien.pdf#chapter.5},
HAL_ID = {hal-03371070},
HAL_VERSION = {v1},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chemexp-0.2.4.tar.gz
.
File metadata
- Download URL: chemexp-0.2.4.tar.gz
- Upload date:
- Size: 66.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5cb7ecff18c7b5406b44b5c5b5c401476df88c35ef0768067746d4f7c909a8 |
|
MD5 | 9374e3b8f01a616f377bc5bcb2556cd1 |
|
BLAKE2b-256 | e14aea23596fdbc3aea6c754e46a265b1765d4bcaf92960da15381ba0f7814da |
File details
Details for the file chemexp-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: chemexp-0.2.4-py3-none-any.whl
- Upload date:
- Size: 69.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d4453583e8d314f6c54a80b9dc942836f5b77a4ccedd2d182a30c2dfe49dae |
|
MD5 | 3b63d14cead9ca79a8a7a271d7d6be3a |
|
BLAKE2b-256 | e023d9ee8ffa9fe866cd4b081eaaa81ffc08ce373e586855be199218e7775885 |