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.

Source Distribution

coci-0.2.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

coci-0.2.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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