Skip to main content

Genetic Algorithm for Generating Metacounterfactual Explanations

Project description

\n# Manic: A Genetic Algorithm-based Metaheuristic Approach for Nature-Inspired Aggregation of Counterfactuals

Table of Contents

Introduction

Manic is a Python package that provides a genetic algorithm-based metaheuristic approach for aggregating counterfactual explanations. It implements a nature-inspired optimization technique to generate counterfactuals that explain the disagreement between different explainers. The goal is to find counterfactual instances that are both diverse and informative to enhance the interpretability of machine learning models.

Installation

To install Manic, use the following pip3 command:

pip3 install manic-xai

Usage

You can use Manic in your Python code as follows:

from manic import Manic

# Define your data_instance, base_counterfactuals, categorical_features, immutable_features, feature_ranges, data, and predict_fn

manic_instance = Manic(data_instance, base_counterfactuals, categorical_features, immutable_features, feature_ranges, data, predict_fn)

# Generate counterfactuals
counterfactuals = manic_instance.generate_counterfactuals()

Docker Instructions

To run Manic using Docker, follow these steps:

  1. Build the Docker image:
docker build -t manic .
  1. Run the Docker container
docker run -v /path/to/your/data:/data -it manic python3 your_script.py

Citation

If you use the Manic package in your research or work and find it helpful, we kindly request that you cite it using the following BibTeX entry:

@software{manic,
  author       = {Craig Pirie},
  title        = {Manic: A Genetic Algorithm-based Metaheuristic Approach for Nature-Inspired Aggregation of Counterfactuals},
  year         = {2023},
  publisher    = {GitHub},
  journal      = {GitHub repository},
  howpublished = {\url{https://github.com/your-username/manic}},
}

We appreciate your support and acknowledgment of our work.

Contact

For any inquiries or collaborations, please contact Craig Pirie at c.pirie11@rgu.ac.uk.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributions

Contributions to the Manic package are always welcome. If you find any issues or have ideas for improvements, please feel free to open an issue or submit a pull request on the GitHub repository. Together, we can make Manic better for everyone.

Changelog

For updates and a history of changes to the Manic package, please refer to the Changelog.

Project details


Release history Release notifications | RSS feed

This version

1.0.8

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manic-xai-1.0.8.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

manic_xai-1.0.8-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file manic-xai-1.0.8.tar.gz.

File metadata

  • Download URL: manic-xai-1.0.8.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for manic-xai-1.0.8.tar.gz
Algorithm Hash digest
SHA256 b0bab785368c15b8bd68566d1bdc39e6b59eb3d373b3c9e504424229fda96122
MD5 7635e5120114f20c35913de6a2c5691b
BLAKE2b-256 43dcf8f65f9c71e97d6f59acdd7f69ebee594ddcf15bfbfd59d9a4697b0443f0

See more details on using hashes here.

File details

Details for the file manic_xai-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: manic_xai-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for manic_xai-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 59887f83cff020aa8c3fa041d12e6ecbe80d0b1c6b11f7e7410500e8c13fc970
MD5 3e21b46a737ba46ccddfedd55f5af0ff
BLAKE2b-256 a5326f8da957eb61bfbbbadde1b1326c06bd71d599cbd7fee7a49191b50b0acf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page