GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ml-libs/mldissect: mldissect - model agnostic predictions explainer

BranchesTags
Open more actions menu

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmark
benchmark
 
 
mldissect
mldissect
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.gitignore
.gitignore
 
 
.pyup.yml
.pyup.yml
 
 
.travis.yml
.travis.yml
 
 
CHANGES.txt
CHANGES.txt
 
 
CONTRIBUTING.rst
CONTRIBUTING.rst
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
Makefile
Makefile
 
 
README.rst
README.rst
 
 
requirements-dev.txt
requirements-dev.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

mldissect

https://travis-ci.com/ml-libs/mldissect.svg?branch=master Maintainability

mldissect is model agnostic predictions explainer, library can show contribution of each feature of your prediction value.

Features

  • Supports predictions explanations for classification and regression
  • Easy to use API.
  • Works with pandas and numpy

Installation

Installation process is simple, just:

$ pip install mldissect

Basic Usage

# lets train a model
boston = load_boston()
columns = list(boston.feature_names)
X, y = boston['data'], boston['target']
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=.2, random_state=seed
)

clf = LassoCV()
clf.fit(X_train, y_train)

# select first observation in test split
observation = X_test[0]
# RegressionExplainer uses training data or sample of training data
# for large dataset to figure out contributions of each feature
explainer = RegressionExplainer(clf, X_train, columns)
result = explainer.explain(observation)
# print/visualize explanation
explanation = Explanation(result)
explanation.print()

result:

+----------+---------+--------------------+
| Feature  | Value   | Contribution       |
+----------+---------+--------------------+
| baseline | -       | 22.611881188118804 |
| LSTAT    | 7.34    | 3.6872             |
| PTRATIO  | 16.9    | 1.3652             |
| CRIM     | 0.06724 | 0.2323             |
| B        | 375.21  | 0.1195             |
| RM       | 6.333   | 0.0411             |
| INDUS    | 3.24    | 0.0312             |
| CHAS     | 0.0     | 0.0                |
| NOX      | 0.46    | 0.0                |
| TAX      | 430.0   | -0.3794            |
| AGE      | 17.2    | -0.5127            |
| ZN       | 0.0     | -0.6143            |
| DIS      | 5.2146  | -1.0792            |
| RAD      | 4.0     | -1.0993            |
+----------+---------+--------------------+

Algorithm

Algorithm is based on ideas describe in paper "Explanations of model predictions with live and breakDown packages" https://arxiv.org/abs/1804.01955

Difference with pyBreakDown

pyBreakDown is similar project, but there is key differences:

  • mldissect is maintained
  • Has tests and good code coverage.
  • Classification is working properly.
  • Multi class support.
  • Top down approach is not implemented.
  • Friendly license.

Requirements

  • Python 3.6+
  • numpy

About

mldissect - model agnostic predictions explainer

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.