Skip to main content

python utils for detect data

Project description

TOAD

PyPi version Python version Build Status Downloads Status

Toad is dedicated to facilitating model development process, especially for a scorecard. It provides intuitive functions of the entire process, from EDA, feature engineering and selection etc. to results validation and scorecard transformation. Its key functionality streamlines the most critical and time-consuming process such as feature selection and fine binning.

Install

Pip

pip install toad

Conda

conda install toad --channel conda-forge

Source code

python setup.py install

Upgrade

Pip

pip install -U toad

Conda

conda install -U toad --channel conda-forge

Key features

  • Simple IV calculation for all
toad.quality(data,'target',iv_only=True)
  • Optimised stepwise feature selection algorithm, and selection by criteria
selected_data = toad.selection.select(data,target = 'target', empty = 0.5, iv = 0.02, corr = 0.7, return_drop=True, exclude=['ID','month'])

final_data = toad.selection.stepwise(data_woe,target = 'target', estimator='ols', direction = 'both', criterion = 'aic', exclude = to_drop)
  • Reliable fine binning with visualisation
# Chi-squared fine binning
c = toad.transform.Combiner()
c.fit(data_selected.drop(to_drop, axis=1), y = 'target', method = 'chi', min_samples = 0.05) 
print(c.export())

# Visualisation to check binning results 
col = 'feature_name'
bin_plot(c.transform(data_selected[[col,'target']], labels=True), x=col, target='target')
  • Intuitive model results presentation
toad.metrics.KS_bucket(pred_proba, final_data['target'], bucket=10, method = 'quantile')
  • One-click scorecard transformation
card = toad.ScoreCard(
    combiner = c,
    transer = transer,
    class_weight = 'balanced',
    C=0.1,
    base_score = 600,
    base_odds = 35 ,
    pdo = 60,
    rate = 2
)

card.fit(final_data[col], final_data['target'])
print(card.export())

Documents

Community

We welcome public feedback and new PRs. We hold a WeChat group for questions and suggestions.

Dedicated by The ESC Team

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

toad-0.0.61.tar.gz (14.0 MB view hashes)

Uploaded Source

Built Distributions

toad-0.0.61-cp38-cp38-win_amd64.whl (14.2 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

toad-0.0.61-cp38-cp38-manylinux2010_x86_64.whl (14.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

toad-0.0.61-cp38-cp38-manylinux1_x86_64.whl (14.9 MB view hashes)

Uploaded CPython 3.8

toad-0.0.61-cp38-cp38-macosx_10_14_x86_64.whl (14.2 MB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

toad-0.0.61-cp37-cp37m-win_amd64.whl (14.2 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

toad-0.0.61-cp37-cp37m-manylinux2010_x86_64.whl (14.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

toad-0.0.61-cp37-cp37m-manylinux1_x86_64.whl (14.8 MB view hashes)

Uploaded CPython 3.7m

toad-0.0.61-cp37-cp37m-macosx_10_14_x86_64.whl (14.2 MB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

toad-0.0.61-cp36-cp36m-win_amd64.whl (14.2 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

toad-0.0.61-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

toad-0.0.61-cp36-cp36m-manylinux1_x86_64.whl (14.8 MB view hashes)

Uploaded CPython 3.6m

toad-0.0.61-cp36-cp36m-macosx_10_14_x86_64.whl (14.2 MB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

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