semvec/pypi-packages huggingface dataset:
mol-inspector 0.0.1
Inspect Molecular ML Models Using SHAP
License: MIT
Requires Python: >=3.10

# mol-inspector - Inspect Molecular ML Models Using SHAP
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py50?style=flat&logo=python&logoColor=white)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

This project is built on [SHAP](https://shap.readthedocs.io/en/latest/index.html) - a game theoretic approach to 
explain the output of machine learning models with figures be generated using [Seaborn](https://seaborn.pydata.org). 
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](/tutorials). The aim of mol-inspector is for ease of use. Generating
SHAP values and plots can be done as follows:
```python
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!
PortableTab 0.3.7.post1
Python package for serializing tables in portable format with Capnp.
License: MIT
Requires Python: <3.13,>=3.9

# PortableTab

![Python 3.8](https://github.com/t-sagara/PortableTab/actions/workflows/python-3.8.yml/badge.svg)
![Python 3.9](https://github.com/t-sagara/PortableTab/actions/workflows/python-3.9.yml/badge.svg)
![Python 3.10](https://github.com/t-sagara/PortableTab/actions/workflows/python-3.10.yml/badge.svg)
![Python 3.11](https://github.com/t-sagara/PortableTab/actions/workflows/python-3.11.yml/badge.svg)
![Python 3.12](https://github.com/t-sagara/PortableTab/actions/workflows/python-3.12.yml/badge.svg)
![Python 3.13](https://github.com/t-sagara/PortableTab/actions/workflows/python-3.13.yml/badge.svg)

*PortableTab* is a Python library that allows for serialization of 
typed tables into a set of files, as well as deserialization of
specific rows extracted from the files.

## Features

The serialized files are independent of OS and CPU architecture, so it can
be used to create portable table which is useful when working with large
datasets that need to be shared between different systems or environments.

It also allows fast deserialization of only specified rows without loading
the entire table into memory, so it does not take time to load and
deserialize the table on the first access, nor consume memory during execution.

- [Capn' Proto](https://capnproto.org/) is used for serialization,
  making the file format portable.
- Since *PortableTab* uses mmap for file access, it does not consume
  much memory even when handling large tables.
- Indexes on strings are created using
  [Marisa-trie](https://github.com/pytries/marisa-trie),
  the output files are also portable and accessible using mmap.

## Limitations

The tables are serialized into compact files so they cannot be dynamically
modified.

- Rows can only be retrieved at their specified position. If you want to
  access by an attribute such as *id*, you must create an index on that attribute.
- Updating records in serialized files is possible but very slow.
- It is not possible to insert rows in the middle of a serialized file. If you
  want to insert rows in the middle, the only way is to deserialize
  the entire table and recreate another table.

## How to use

Please refer to the documentation at
[PortableTab Document](https://portabletab.readthedocs.io/en/latest/).

## Development status

Unstable alpha version.

## License

This package is available according to the MIT license.

## Author

Takeshi SAGARA <sagara@info-proto.com>