Toad is dedicated to facilitating model development process, especially for a scorecard.
Project description
TOAD
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',iv_only=True)
- 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使用交流的微信群,欢迎询问加群。
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
Built Distributions
Hashes for toad-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cb734d5ba15294a3de74f0db4da27ce0732010676364b3c69f3f0ae348323d6 |
|
MD5 | e9f0f4f34bceb9aa333a5fcd3ce14d46 |
|
BLAKE2b-256 | acbf74e38ce5044c660ef466d4f078d383ba4421e16fd7316cf8b4de45335e8d |
Hashes for toad-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f42053a6f9a2320856882c874f3c176476909d2895ecb437e800f487267c19d |
|
MD5 | f988bde5389b8bd339eb2994b00eaa46 |
|
BLAKE2b-256 | 60631c0e4823f98d54592c281d79efdfa69250a50d9d6c964be4a801bee13ee5 |
Hashes for toad-0.1.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11bd0104987397d07d7caaa55b70f3924f17afc0c07a9cd7f609b1563855bd1a |
|
MD5 | 9fcaa446c06138b88b6f77e143977554 |
|
BLAKE2b-256 | f08be0eff88488a6ed8a6fe9fe073bc38d9b1de90e6c9ffda8a0b161a94bd791 |
Hashes for toad-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a29a46eaf944cbcee81fde6c8fcd9c0e1d8b7d39b56a06622f21f8c6f0a60b6 |
|
MD5 | 570fca53629bf5b8e28edab1002208c3 |
|
BLAKE2b-256 | 6a76363e4dfd9b3f6fab9748210f7fd2cbd89f1b97d664171f8d6b43d61c36cd |
Hashes for toad-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a4ee0a986d99c3ef74d8dd4522cad60e251593dfd6e90145638e956a795c913 |
|
MD5 | 2eda9f261310d6caebd95a32f881ff6b |
|
BLAKE2b-256 | 358028566709aee719bc21715fb034fd9968f60fe432ade6a8fa4c4e38d85a6b |
Hashes for toad-0.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3f28e7467afdab2fa1df3b67db723c643ae3cac7c8e8da966630144e13c440d |
|
MD5 | 26ef51ad0dbfe5e99eb85b02194bbac9 |
|
BLAKE2b-256 | d55c86ee9eee43b3abaf8c1fbc2a08270fe388e85ece62fa6f791a5583a9c2e6 |
Hashes for toad-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4979aa5654eed50891ef4174cf05b29b086845c1ab97b6c0118847c9a2a40b |
|
MD5 | 8f73bfa137481b9861e39e21f202c3b2 |
|
BLAKE2b-256 | 36b46a19c44e95bb608b86dd9473ee78ea91e9090143b8675aedda06d8d54ed9 |
Hashes for toad-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6384740d6f71b071bfed93d1384b2266d6b5fcad2d8a1cc8a53fa7ed15b57e64 |
|
MD5 | 2f5ddd57b62f39079da2f79a5b453ec6 |
|
BLAKE2b-256 | 04cfa68773fd40956fd3b952d8cade91609791cf6b0e97a4e2a12d80bedc1cb3 |
Hashes for toad-0.1.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b30bd85b4f244a23138573b441de72d6ce711400054b54f0633e9ea5e144265e |
|
MD5 | 825e87deafe06f7e4680559f9f4c852c |
|
BLAKE2b-256 | 1815a6afb21de0f92585c2249ecf9432023497419bc2541b42a61c9b43eceb4d |
Hashes for toad-0.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee2eb1f18ac271fbe0ca53ef018cf587326c4ebba6ce9ae30ad473b02c09a97f |
|
MD5 | 71f89a907df3240b8348741f8153aeb3 |
|
BLAKE2b-256 | 06e77101994561dfaf9e30c18564fa3342f60f653b7a666a468fb85a3ccdf592 |