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.63-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb3daa5965649c91b6d84ecb33118a84943b15662a3b0ce4b1ce5a6602e178e |
|
MD5 | 0777efbbeb93c3832a698b6c2c28da21 |
|
BLAKE2b-256 | ca8eb7e7d8ba790aaae42a5fe91a3120fe8a995af5b3107f77d5a65e984defbc |
Hashes for toad-0.0.63-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbde0cb1594945599f6c7e333dc30ab1937cdf9f402ef1d339f390e494049062 |
|
MD5 | 439c874bf09914af74b1ad7c7e7c8ff4 |
|
BLAKE2b-256 | 20f7897c6eab4e24ebdf8ac5e994d2e6e437592b4db8afd835e80fa4a0f9ce64 |
Hashes for toad-0.0.63-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa57e2ee5981cf81f525b1f0a6504ac3b8c3439d8abf421317831a2aaebbef76 |
|
MD5 | 36ee049314fadff5f233607828d82b1e |
|
BLAKE2b-256 | 58f7625c70d435ebb7e1058f2767d61f6da3730cc6355c0d0ed205c7d108631b |
Hashes for toad-0.0.63-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0326a402db52caf6e0e59f973342d83591890b7b661a4352dede6bd323715d |
|
MD5 | d5a523e0347130bd39400988f42524ff |
|
BLAKE2b-256 | 56376044af6b0cf0cfe8a7020ca2643e741d6b48e4b4b08164e61bc6d34a70b0 |
Hashes for toad-0.0.63-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da69cd5aacd458808abc017a22c6634707967985f18ad9a4c56ce5ba06a5b63c |
|
MD5 | 3eb718dffb2df40d03114e824d934514 |
|
BLAKE2b-256 | 9303a5d96f9188d22d45b76137e14bb0298cd6ef1c9ec69612a5a28286007f36 |
Hashes for toad-0.0.63-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e61a413f9c746a0127e4acc95a63daf2c14ea9a90db2299c64c86eda861ed8 |
|
MD5 | 3d18171371cd8940fbbc51c68bdc9ca6 |
|
BLAKE2b-256 | c0c65a47a68bb1b68653f32df0d3fbec45e8d0ae9c6933ffbc28e066a534275a |
Hashes for toad-0.0.63-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca79955ad3d1eae8805bd8ceb45c23e5f1cc3318f4d2e4e9ef69b8b073eab9a2 |
|
MD5 | 38befa6153f8ae74faee675d32d47ded |
|
BLAKE2b-256 | 8a72e328e3178e725b4288136f1a483a0d3c9bd40dddc1be12cfb7bf75bc70c7 |
Hashes for toad-0.0.63-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b59385ceb78626cd90f16753e39a6f3318af82cf6e9b955dc17446091b041a24 |
|
MD5 | 01cc15021a569455ba090d660ddff31d |
|
BLAKE2b-256 | e0ef918d5512e4d94b80cf3f394ce0fec080f1c77bf9891827d55b321a409e2f |
Hashes for toad-0.0.63-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35b7ef83caea38f60a0face4ffe010f5e016e6c5703ae0f2a73a7d029623a67c |
|
MD5 | 2617e42e5e8fb55fcd5d492a6e1a8cb4 |
|
BLAKE2b-256 | 954f2ef066ce02eda0aff3902fe40a4968dddcfd3c70cf823f570a969d0eb227 |
Hashes for toad-0.0.63-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b293ddf5d395a412d7d8c4cc7432bdf136820abc62eaa965940666e5ade01839 |
|
MD5 | b80c42d2ab164d1fef4f86c7c1ac51a0 |
|
BLAKE2b-256 | 5685aa7684bbab6b9049e879c1c23f4244cb8c053704232aa1cac2970c8d37c4 |
Hashes for toad-0.0.63-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 549ca089ae7efb9362216b6d623e6219bc5067fbf825500f093fe965457fc960 |
|
MD5 | 436d341496ebd9e384d0307119530825 |
|
BLAKE2b-256 | c9899562cd1533a7c5ec816ff4decae786623e3b4518ee43df08164c91d8ac46 |
Hashes for toad-0.0.63-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df8ef2c277ce78eb6edd97af9c55f13ad388900cea769ae0177d2d381fc22c20 |
|
MD5 | 5a0701126b3d1a5e1bdc012ab1c219d9 |
|
BLAKE2b-256 | 963f1886029e1ef773bff37e913e5bfdba4e459645ed1f3c46928d2c91385903 |