Giter Club home page Giter Club logo

pdpbox's Introduction

PDPbox

PyPI version Build Status

python partial dependence plot toolbox

Motivation

This repository is inspired by ICEbox. The goal is to visualize the impact of certain features towards model prediction for any supervised learning algorithm. (now support all scikit-learn algorithms)

The common headache

When using black box machine learning algorithms like random forest and boosting, it is hard to understand the relations between predictors and model outcome.

For example, in terms of random forest, all we get is the feature importance. Although we can know which feature is significantly influencing the outcome based on the importance calculation, it really sucks that we don’t know in which direction it is influencing. And in most of the real cases, the effect is non-monotonic.

We need some powerful tools to help understanding the complex relations between predictors and model prediction.

Highlight

  1. Helper functions for visualizing target distribution as well as prediction distribution.
  2. Proper way to handle one-hot encoding features.
  3. Solution for handling complex mutual dependency among features.
  4. Support multi-class classifier.
  5. Support two variable interaction partial dependence plot.

Documentation

Tutorials

https://github.com/SauceCat/PDPbox/tree/master/tutorials

Change Logs

https://github.com/SauceCat/PDPbox/blob/master/CHANGELOG.md

Installation

  • through pip (latest stable version: 0.2.0)

    $ pip install pdpbox
    
  • through git (latest develop version)

    $ git clone https://github.com/SauceCat/PDPbox.git
    $ cd PDPbox
    $ python setup.py install
    

Testing

PDPbox can be tested using tox.

  • First install tox and tox-venv

    $ pip install tox tox-venv
    
  • Call tox inside the pdpbox clone directory. This will run tests with python 2.7 and 3.6 (if available).

  • To test the documentation, call tox -e docs. The documentation should open up in your browser if it is successfully build. Otherwise, the problem with the documentation will be reported in the output of the command.

Gallery

  • PDP: PDP for a single feature

  • PDP: PDP for a multi-class

  • PDP Interact: PDP Interact for two features with contour plot

  • PDP Interact: PDP Interact for two features with grid plot

  • PDP Interact: PDP Interact for multi-class

  • Information plot: target plot for a single feature

  • Information plot: target interact plot for two features

  • Information plot: actual prediction plot for a single feature

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.