Skip to main content

mol-inspector - Inspect Molecular ML Models Using SHAP

mol-inspector Python Versions License: MIT

This project is built on SHAP - a game theoretic approach to explain the output of machine learning models with figures be generated using Seaborn. While this project should be able to work with any data generated from SHAP values, it was built with molecular fingerprints in mind. As a result, simple methods are also included that will render molecular fingerprint bits using RDKit.

Tutorials

Tutorials can be found under the Tutorials folder. The aim of mol-inspector is for ease of use. Generating SHAP values and plots can be done as follows:

from mol_inspector import Inspector, Plots

# generating SHAP values
inspector = Inspector(model=model, train_feats=train_feats, model_type="auto")
values = inspector.values(test_feats)

# generating plots
plot = Plots(values, train_feats, test_feats)
plot.summary_plot()

Users can also import and generate shap values natively, then feed the shap values into the Plots() class to generate the Seaborn plots.

Installation

Project can be pip installable:

pip install mol-inspector

[!NOTE] As my background is in cheminformatics, RDKit will also be installed. This allows for methods to draw molecular fingerprint bits. I may "split" this code upon user request.

Motivations

When experimenting with the SHAP package, I found difficulties in generating customized color palettes for my figures. This project seeks to remedy that by extracting the generated SHAP values and using the data to generate figures using Seaborn. This would allow easier customization of color palettes for presentations.

Future Contributions

Currently only three plot types have been converted. This is due to how I implement SHAP into my projects. I welcome contributors or requests for additional plot options to be converted into seaborn. Just let me know!

Metadata

Release files for mol-inspector 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mol-inspector 0.0.2
File Size Uploaded Provenance Actions
mol_inspector-0.0.2.tar.gz 13.1 kB Without provenance Details for mol_inspector-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mol-inspector 0.0.2
File Interpreter ABI Platform Actions
mol_inspector-0.0.2-py3-none-any.whl Python 3 none any Details for mol_inspector-0.0.2-py3-none-any.whl

Total release size: 27.0 kB

Release files / mol_inspector-0.0.2.tar.gz

Download URL mol_inspector-0.0.2.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c1205b0107f8a6c40ed1c264819b10f5f750dda282d11df0f2f8d01fbf788065
BLAKE2b-256 checksum
How to use checksums
8e69358b60167602b1271b9c5fd5f6714b1b57155c63314e1177de7644fbc92d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.2 Darwin/25.4.0

Release files / mol_inspector-0.0.2-py3-none-any.whl

Download URL mol_inspector-0.0.2-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08ca089ceb6e4156f9f0282d96e339b75540c213fff3aa76cd884aa605dd574c
BLAKE2b-256 checksum
How to use checksums
4f01f8dd2544880b12288763d7224f95aa190e101c4359cdffef58487c2f70f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.2 Darwin/25.4.0

Security for mol-inspector 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page