python utils for detect data
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.0.62-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f31a9cff0d4d2ce61d0b7f4a42c49f1e7cb1e9425204a8dcbf7795898ecf113 |
|
MD5 | 8fc91a68db10d6b7f3840639b15662ac |
|
BLAKE2b-256 | eaf69af95ed3dd193fae765d3c5ab420ef2e41d5497601020c832a2f9fcd4249 |
Hashes for toad-0.0.62-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a517738f04444eabd7258fda94c1f021d612246a969e6d6d562527f7b1723e81 |
|
MD5 | a6743c54c8fe62aebba0b5b79fc15ae8 |
|
BLAKE2b-256 | 01e27cd334ceab22a029ba04aa7ec8a7c7421ce728a292f0dc35f46d7dd9d2c7 |
Hashes for toad-0.0.62-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0279371bb75303be3023558004866508d2f0522b01fd8bef6fdefd3187bc735 |
|
MD5 | edafe1c8a78c0dd158b477449da86ab0 |
|
BLAKE2b-256 | 83a555d8edeabe534b36392c32217e382b7cbb77ef688b8eba62b218856579c7 |
Hashes for toad-0.0.62-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afd63158e301f11fe7e8d754a131ae32ec999e1b99aa61ee2169ed9c34e1f820 |
|
MD5 | dc25fbc9802f13a253692c3968d3d6bd |
|
BLAKE2b-256 | 405f845719bc35558ba3accfe3629568024e99ed20a68496b02c88866e5d8a7d |
Hashes for toad-0.0.62-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d94dc6285e173732f51cdfce5a55901bcbb4ee60eb968c675ea6a858f9db98 |
|
MD5 | 8a7d754fa34a7e3f54a3cccd2eb54b61 |
|
BLAKE2b-256 | 9b4ffa7e101b4964723a49a1ad2348dce76c72af4104ff34fa6ed7467d3c325b |
Hashes for toad-0.0.62-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 803a1288e4254466059b0bb422543316d31f202d6f59cee3af2ff496c042df4a |
|
MD5 | ce1f7465604b7d9f54ef612f66c8e12a |
|
BLAKE2b-256 | 5d8723a537d5cb000c65f2f6aa326bd4ac8099f5ad20b1e80c8e3ecb9f0c8ca7 |
Hashes for toad-0.0.62-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30c1d23819057383fd1b04ea78f8901d33afee4a7c44472f45eed9773d762925 |
|
MD5 | cfaa7a350bbb579485fededbde4b9405 |
|
BLAKE2b-256 | 45336f121995bf4a5cb5c2a85201d8223b4e123a04df72b584439ce54a710279 |
Hashes for toad-0.0.62-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2459e07abe663ec4cf00dc6f784d7627b1f08cce7c802f09058e498c2de6956 |
|
MD5 | 4c56686012a4ca2ab0f805d9d2eacdb9 |
|
BLAKE2b-256 | 601e85594dd1e5ae09f80a26842b64f3100afb8c79d8b471c0a558f853a73756 |
Hashes for toad-0.0.62-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71dbf7bcd1aa2ebaed817e8a05f8acd52b49eb01e0d3bdc1657397f2a8ff6ddd |
|
MD5 | 5b7a5f23b3cf67680df63ccac5d9c296 |
|
BLAKE2b-256 | d1883528c27200d1606105766d24a82a7061bf8212d90433d02a736779d6a4cf |
Hashes for toad-0.0.62-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58883c4cc58c7775d6f001f51e13bff12440a64a51e82de39182c648a2994578 |
|
MD5 | b91c3484583cf37f907f6462720879e8 |
|
BLAKE2b-256 | a38a63433afd9a9a5804db7727b48510a89d4569f1d8dd40510ae4d4f87cf9ef |
Hashes for toad-0.0.62-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e8d08a4dc0a2633229546f3a8b97e7fdad98f72504c777d35c42808ee073b51 |
|
MD5 | ac7e9af1be693e5755211cd7e8dfadaf |
|
BLAKE2b-256 | fd552bf1d78b755137802c75c4ecb0683adddaf3f08152fec5cdd0f174631e9d |
Hashes for toad-0.0.62-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57f8adcae9bda3cb0aa5c59558ed2d86ca4812a327083d2419891c00bbede4ce |
|
MD5 | d289d0835f032b9dd9396af3013ba870 |
|
BLAKE2b-256 | b8badbd7af493ea40d77b4ac6a362169fe2b5bd9650f6d7efadce3e9c7ab12a6 |