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.62a0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64c5c19d7f072ffeeeacbebe6b71da20e39e460b770586153ff8e311aebc4e3b |
|
MD5 | 69ba336459679d937385676d3ff8c13d |
|
BLAKE2b-256 | e06859df827ff79b9621528375a22b4bde8e9848478f05f2f7ffa9d16be06ca1 |
Hashes for toad-0.0.62a0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dff5fb0ea0c6e195216da0055c482dd18ffb5ff01c513a6c3dcc8535d4760ee8 |
|
MD5 | 00735d3780c9562f2c6a0d5075e99992 |
|
BLAKE2b-256 | b27ec58dbe65585baf64042b2409d553752938d8d1d612fbed3ee738fb3fa8ab |
Hashes for toad-0.0.62a0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b8d9c7bd66baa99375588f88582d5ec068a8c9d3b67abb0e9bb9d6da273b6a8 |
|
MD5 | 01c3b01ccead48e1e979334b11dfc0db |
|
BLAKE2b-256 | d7929030b92a88c31f3885a19076438e96a8ed20f259e42f0fbf375977154b6b |
Hashes for toad-0.0.62a0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e249755bec36aae73fcc67c06e36b8fdd6dd7f615a2797062abbc166acd46b9e |
|
MD5 | 2367ccd32bd1c5fd36171a59963f97c2 |
|
BLAKE2b-256 | 13144ae22ab6a65160db2e396c54bd1aba4e02d9b775d52fd74c95fdd5b26ca1 |
Hashes for toad-0.0.62a0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31ccbcd84a0599cc0fee6829960b00000b42d0d22f28d53d994c16a2f30d8e90 |
|
MD5 | 0c64d52e082fb00e05e5a8860275b376 |
|
BLAKE2b-256 | f41ed807c2c37164de277a02d9e11bca87be9a1c61b4c6fa77e3965efc5ca06f |
Hashes for toad-0.0.62a0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41d1007759a4265d02b920830add0bc12df6f4cce709c84e7316446541d09a3f |
|
MD5 | 78bace7ab28cf23540514dd52dc78527 |
|
BLAKE2b-256 | 32e4e21fe36d1b846eb53bb9d7a6e35332cb43589e2f36f71afed088944dc615 |
Hashes for toad-0.0.62a0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 468556017ff923205e377063c3da0cdc817375c9b64ae516b5be414d41a9fddc |
|
MD5 | 81109222804fa8f11888479155b82789 |
|
BLAKE2b-256 | 4c28290a1334d0f9b1d59c68324df2bc4ad13efb2bf536c00ad1ffa2486fdb79 |
Hashes for toad-0.0.62a0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f46a75dbabf2f60eb68c2a1e02472a14bb126ab767272def8ca8a86fd639c0e4 |
|
MD5 | 6cb20d9b6331eb4d638663351a20ae9a |
|
BLAKE2b-256 | 8f6d7dfbeead9f464f3b9171af863b550e4fba85e073cab2279168689071f719 |
Hashes for toad-0.0.62a0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ec57e70a5f0eb4b9aa5cf7b89d4ce68cc11992dbbf26672d79c654c180f985 |
|
MD5 | 90d8029c1c70de95a87c8b1835a414c1 |
|
BLAKE2b-256 | 84748f97a8051cdffc8ac5461dcdd32ef74d860f40412bfb30d7cd5aae13beea |
Hashes for toad-0.0.62a0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 197e2bf02540ad5c905d5ccd28bdea91910cfc6c897923a7d365894c4e47c34f |
|
MD5 | 72aa22c373b8fe13fc193e26e6f0fee3 |
|
BLAKE2b-256 | d52aec0cae6d2007b21f9d75af08fecb07b2a95d3736316ec9a808f901302715 |
Hashes for toad-0.0.62a0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63748339ca37e4fd98b9d819b9eb4476cde11a647fa96099c316d42f7f3ee51f |
|
MD5 | d025590613ffd3ef0e9e1da5e27c6530 |
|
BLAKE2b-256 | e60a64416c8afd984486d3912e553de2021f9b58614c82d13dc76aa13cbd23db |
Hashes for toad-0.0.62a0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe153111b568b00446d9185498f2cff350922ba635491a34963a564f87f6c44b |
|
MD5 | 2d2fd604e74b7988a9b77f7f966e555e |
|
BLAKE2b-256 | 302651d6a13be91322fe82c05830d36bb81db8e4f6eee2511e0682ad71095edc |