mlbugdetection


Namemlbugdetection JSON
Version 0.0.12 PyPI version JSON
download
home_page
SummaryA package for identify Machine Learning bugs
upload_time2022-11-30 17:31:05
maintainer
docs_urlNone
authorJoão Gianfaldoni | Giovanni Cardoso | William Silva
requires_python
license
keywords python machine learning bug detection
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MLBugDetection

Machine learning explainability and unexpectated behaviors detection

## Overview

Most machine learning explainability packages requires both trained models and the training data to create Explainer objects that explain the model's behavior. This package allows ceteris paribus analysis of features using only the trained model and one or more input samples.

## Documentation

- https://jpgianfaldoni.github.io/MLBugDetection/

# Installation: 

```bash
pip install mlbugdetection
```

# How to use
## Functions



1. Monotonic:
    ```py
    from mlbugdetection.monotonic import check_monotonicity_single_sample, check_monotonicity_multiple_samples
    ```

    Usage:
    For 1 sample
    ```py
    check_monotonicity_single_sample(model, sample, feature, start, stop, step=1)
    ```
    
    For more than 1 sample:
    ```py
    check_monotonicity_multiple_samples(model, samples, feature, start, stop, step=1) 
    ```
    

2. Critical Values:
    ```py
    from mlbugdetection.critical_values import find_critical_values, find_several_critical_values
    ```
    
    Usage:
    For 1 sample
    ```py
    find_critical_values(model, sample, feature, start, stop, step=1)
    ```

    For more than 1 sample:
    ```py
    find_several_critical_values(model, samples, feature, start, stop, step=1, bins=15, keep_n=5, log=False)
    ```


3. Calibration:
    ```py
    from mlbugdetection.calibration import calibration_check
    ```
    
    Usage:
    ```py
    calibration_check(model, samples, target, pos_label=1)
    ```

4. Sanity:
    ```py
    from mlbugdetection.sanity import sanity_check, sanity_check_with_indexes
    ```

    Usage:

    ```py
    sanity_check(model, samples, target)
    ```

    If test not pass, check the indexes
    ```py
    sanity_check_with_indexes(model, samples, target)
    ```


---

## Virtual Environment with Jupyter Notebook

```bash
python3 -m virtualenv venv 
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mlbugdetection",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,machine learning,bug detection",
    "author": "Jo\u00e3o Gianfaldoni | Giovanni Cardoso | William Silva",
    "author_email": "william.silva.ismart@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/64/13/a271cd9397e5f2cfe050b47707ba912d2f64796b6b562627e6d96aa496c4/mlbugdetection-0.0.12.tar.gz",
    "platform": null,
    "description": "# MLBugDetection\n\nMachine learning explainability and unexpectated behaviors detection\n\n## Overview\n\nMost machine learning explainability packages requires both trained models and the training data to create Explainer objects that explain the model's behavior. This package allows ceteris paribus analysis of features using only the trained model and one or more input samples.\n\n## Documentation\n\n- https://jpgianfaldoni.github.io/MLBugDetection/\n\n# Installation: \n\n```bash\npip install mlbugdetection\n```\n\n# How to use\n## Functions\n\n\n\n1. Monotonic:\n    ```py\n    from mlbugdetection.monotonic import check_monotonicity_single_sample, check_monotonicity_multiple_samples\n    ```\n\n    Usage:\n    For 1 sample\n    ```py\n    check_monotonicity_single_sample(model, sample, feature, start, stop, step=1)\n    ```\n    \n    For more than 1 sample:\n    ```py\n    check_monotonicity_multiple_samples(model, samples, feature, start, stop, step=1) \n    ```\n    \n\n2. Critical Values:\n    ```py\n    from mlbugdetection.critical_values import find_critical_values, find_several_critical_values\n    ```\n    \n    Usage:\n    For 1 sample\n    ```py\n    find_critical_values(model, sample, feature, start, stop, step=1)\n    ```\n\n    For more than 1 sample:\n    ```py\n    find_several_critical_values(model, samples, feature, start, stop, step=1, bins=15, keep_n=5, log=False)\n    ```\n\n\n3. Calibration:\n    ```py\n    from mlbugdetection.calibration import calibration_check\n    ```\n    \n    Usage:\n    ```py\n    calibration_check(model, samples, target, pos_label=1)\n    ```\n\n4. Sanity:\n    ```py\n    from mlbugdetection.sanity import sanity_check, sanity_check_with_indexes\n    ```\n\n    Usage:\n\n    ```py\n    sanity_check(model, samples, target)\n    ```\n\n    If test not pass, check the indexes\n    ```py\n    sanity_check_with_indexes(model, samples, target)\n    ```\n\n\n---\n\n## Virtual Environment with Jupyter Notebook\n\n```bash\npython3 -m virtualenv venv \nsource venv/bin/activate\npython -m pip install --upgrade pip\npip install -r requirements.txt\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A package for identify Machine Learning bugs",
    "version": "0.0.12",
    "split_keywords": [
        "python",
        "machine learning",
        "bug detection"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "410a2811cd8f6cfd44d8e813479e83a8",
                "sha256": "a45ec1b1752bee3ad8399623dbde9af2fc8739bc21bba4eeed1c03ecc4a9f3b0"
            },
            "downloads": -1,
            "filename": "mlbugdetection-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "410a2811cd8f6cfd44d8e813479e83a8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1309471,
            "upload_time": "2022-11-30T17:31:00",
            "upload_time_iso_8601": "2022-11-30T17:31:00.493659Z",
            "url": "https://files.pythonhosted.org/packages/2a/52/9a85e1dd30383bf02641f000c0be6fe79e24f0215794ca51256646f6c3d3/mlbugdetection-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "09f20552e5efd19ed9570ff24bf99b61",
                "sha256": "65f4f9c3974cbb5e3cf09c2b001b859b325946401b5c9c8ca3b5144ce5db33a2"
            },
            "downloads": -1,
            "filename": "mlbugdetection-0.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "09f20552e5efd19ed9570ff24bf99b61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1309519,
            "upload_time": "2022-11-30T17:31:05",
            "upload_time_iso_8601": "2022-11-30T17:31:05.578928Z",
            "url": "https://files.pythonhosted.org/packages/64/13/a271cd9397e5f2cfe050b47707ba912d2f64796b6b562627e6d96aa496c4/mlbugdetection-0.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-11-30 17:31:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "mlbugdetection"
}
        
Elapsed time: 0.02536s