Skip to main content

Collective Observation on Causal Inference

Project description

COCI

Collective Observation on Causal Inferences

Coci makes it easy to observe the changes in predictions from machine learning models based on the alterations of feature values.

Why Coci?

Machine learning has always been understood as a black box algorithm, which makes the decision makers hesitant to trust the predictions from this approach.

Shap and Lime has unveiled a lot of mysteries around the effects of the presence of each feature on outcomes. However, these methods cannot show the change in outcomes when features are tweaked.

Coci takes it a step further, and reveals the effects on outcomes when changing feature values.

Installation

pip install coci==0.1.7

Summary Plot

Sample code

import coci

explainer = coci.TreeExplainer(model)

explainer.sensitivity(X_test, 
                    feature_names=feature_names,
                    split_num=2,
                    sample_size=300)

explainer.summary_plot(max_display=10)

Reading the summary plot

Summary Plot

Trend Plot

Sample code

import coci 

explainer = coci.TreeExplainer(model)

explainer.sensitivity(X_test, 
                    feature_names=feature_names,
                    split_num=2,
                    sample_size=300)

explainer.trend_plot(feature_name=['要介護認定等基準時間(食事)'])

## or show by index
explainer.trend_plot(feature_index=[1276])

## or show the top ranked features
explainer.trend_plot(max_display=10)

Reading the trend plot

Project details


Download files

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

Files for coci, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size coci-0.2.0-py3-none-any.whl (7.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size coci-0.2.0.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page