Skip to main content

Toad is dedicated to facilitating model development process, especially for a scorecard.

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.

Toad 是专为工业界模型开发设计的Python工具包,特别针对评分卡的开发。Toad 的功能覆盖了建模全流程,从 EDA、特征工程、特征筛选 到 模型验证和评分卡转化。Toad 的主要功能极大简化了建模中最重要最费时的流程,即特征筛选和分箱。

Install and Upgrade · 安装与升级

Pip

pip install toad # to install
pip install -U toad # to upgrade

Conda

conda install toad --channel conda-forge # to install
conda install -U toad --channel conda-forge # to upgrade

Source code

python setup.py install

Key features · 主要功能

The following showcases some of the most popular features of toad, for more detailed demonstrations and user guidance, please refer to the tutorials.

以下部分简单介绍了toad最受欢迎的一些功能,具体的使用方法和使用教程,请详见文档部分。

  • Simple IV calculation for all features · 一键算IV:
toad.quality(data, 'target', indicators = ['iv'])
  • Preliminary selection based on criteria · 根据特定条件的初步变量筛选;
  • and stepwise feature selection (with optimised algorithm) · 优化过的逐步回归:
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.

欢迎各位提PR,同时我们有toad使用交流的微信群,欢迎询问加群。

Contributors

Contributors


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.1.6.tar.gz (14.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

toad-0.1.6-cp39-abi3-win_amd64.whl (195.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

toad-0.1.6-cp39-abi3-manylinux_2_34_x86_64.whl (306.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

toad-0.1.6-cp39-abi3-macosx_11_0_arm64.whl (271.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file toad-0.1.6.tar.gz.

File metadata

  • Download URL: toad-0.1.6.tar.gz
  • Upload date:
  • Size: 14.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for toad-0.1.6.tar.gz
Algorithm Hash digest
SHA256 9a993573b9ac65dd7ebabda9eeebc5122680ab1cb17fa5d1f29a4919a2243a85
MD5 f947f1ee408d7e66bfa76f5f3b360ea9
BLAKE2b-256 2000cd85e5eecd6244e4641b1ba149e9370d9ea9876f012bffa3b26d584290b0

See more details on using hashes here.

File details

Details for the file toad-0.1.6-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: toad-0.1.6-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 195.0 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for toad-0.1.6-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 32554a3ddeac44c779e853e4b50402a7614aa92b6bd20c12ac875f32d5d316c9
MD5 1126aa2ff602ed2b47c108a6d2f3059b
BLAKE2b-256 d3a9a64d9a8c232394e5f3c6f4a7e84e553f2dd7b363804524e077b60fa12d48

See more details on using hashes here.

File details

Details for the file toad-0.1.6-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: toad-0.1.6-cp39-abi3-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 306.1 kB
  • Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for toad-0.1.6-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c6fc97d3e6b3750266a968172b746438f3b013d20d5df159a31747d9b257b4e8
MD5 f17dde8dc06ab0bef30b0efa3f470bbe
BLAKE2b-256 ac2c5154553e61846cb66e855d22c5a6d3c0928959b548eaec2107ed423ec47c

See more details on using hashes here.

File details

Details for the file toad-0.1.6-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: toad-0.1.6-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 271.2 kB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for toad-0.1.6-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91b6bbfbf028d95a9a4fc7abdb014a9858678096702b1b8f54675326094eca9d
MD5 8a09a12f26f3f4d386be9d4f312d6c39
BLAKE2b-256 3873836ffd3464bba6546ffca2bfc93a3da02c8c25975895016aab7a05344f5c

See more details on using hashes here.

Supported by

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