Skip to main content

Inspect ML Pipelines in the form of a DAG

Project description

mlinspect

mlinspect GitHub license Build Status codecov

Inspect ML Pipelines in Python in the form of a DAG

Run mlinspect locally

Prerequisite: python == 3.8 (current blocker: sklearn does not support 3.9 yet it seems)

  1. Clone this repository

  2. Set up the environment

    cd mlinspect
    python -m venv venv
    source venv/bin/activate

  3. Install pip dependencies

    pip install -e .[dev]

  4. If you want to use the visualisation functions we provide, install graphviz which can not be installed via pip

    Linux: apt-get install graphviz
    MAC OS: brew install graphviz

  5. Run the tests

    python setup.py test

Vision

Make it easy to analyze your pipeline and automatically check for common issues.

from mlinspect import PipelineInspector
from mlinspect.inspections import MaterializeFirstOutputRows
from mlinspect.checks import NoBiasIntroducedFor

IPYNB_PATH = ...

inspector_result = PipelineInspector\
        .on_pipeline_from_ipynb_file(IPYNB_PATH)\
        .add_required_inspection(MaterializeFirstOutputRows(5))\
        .add_check(NoBiasIntroducedFor(['race']))\
        .execute()

extracted_dag = inspector_result.dag
inspection_to_annotations = inspector_result.inspection_to_annotations
check_to_check_results = inspector_result.check_to_check_results

Detailed Example

We prepared a demo notebook to showcase mlinspect and its features.

Notes

  • For debugging in PyCharm, set the pytest flag --no-cov (Link)
  • This is a research project, so comprehensive coverage of all possible ML APIs will not be possible in the current initial step. We will try to tell you if we encounter APIs we can not handle yet.

License

This library is licensed under the Apache 2.0 License.

Project details


Download files

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

Source Distribution

mlinspect-0.0.1.dev0.tar.gz (59.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlinspect-0.0.1.dev0-py3-none-any.whl (90.7 kB view details)

Uploaded Python 3

File details

Details for the file mlinspect-0.0.1.dev0.tar.gz.

File metadata

  • Download URL: mlinspect-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for mlinspect-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 48d6705ea1d369c35a7141c60e88ed273f67f2adfff496b0bf2cea3a8604caa4
MD5 e459ea0d0cdbeaa1b4ceba2d6ee5ac90
BLAKE2b-256 ce62d2b930817588b9c06f6cf3c10739211ac1decf290abf3f81a7a4debe8a47

See more details on using hashes here.

File details

Details for the file mlinspect-0.0.1.dev0-py3-none-any.whl.

File metadata

  • Download URL: mlinspect-0.0.1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for mlinspect-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 2668c818b4a7bf028986b5a681e0d457cd1dc1943a212162da62dc08cbf62a29
MD5 9d62bc2282f728619d36903855af2afa
BLAKE2b-256 51c4cea3b10a691e7b87120b976ebb5e29d7cfc73e97849c2cafa70fe3ba3092

See more details on using hashes here.

Supported by

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