GithubHelp home page GithubHelp logo

andreas-grafberger / mlinspect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stefan-grafberger/mlinspect

0.0 0.0 0.0 16.87 MB

Inspect ML Pipelines in Python in the form of a DAG

License: Apache License 2.0

Python 32.23% Jupyter Notebook 67.74% Dockerfile 0.03%

mlinspect's Introduction

mlinspect

mlinspect GitHub license Build Status codecov

Inspect ML Pipelines in Python in the form of a DAG

Run mlinspect locally

Prerequisite: Python 3.9

  1. Clone this repository

  2. Set up the environment

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

  3. 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

  4. Install pip dependencies

    pip install -e .[dev]

  5. To ensure everything works, you can run the tests (without graphviz, the visualisation test will fail)

    python setup.py test

How to use mlinspect

mlinspect makes 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
dag_node_to_inspection_results = inspector_result.dag_node_to_inspection_results
check_to_check_results = inspector_result.check_to_check_results

Detailed Example

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

Supported libraries and API functions

mlinspect already supports a selection of API functions from pandas and scikit-learn. Extending mlinspect to support more and more API functions and libraries will be an ongoing effort. However, mlinspect won't just crash when it encounters functions it doesn't recognize yet. For more information, please see here.

Notes

  • For debugging in PyCharm, set the pytest flag --no-cov (Link)

Publications

License

This library is licensed under the Apache 2.0 License.

mlinspect's People

Contributors

adrianlut avatar stefan-grafberger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.