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 Distributions
Built Distributions
Hashes for toad-0.0.64a1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6160a18818d765fa9a7ca16e1e7d9ec83c24c08993ffa46d60707b624322cc98 |
|
MD5 | e6ed137e83c18b6930ab2132943c7693 |
|
BLAKE2b-256 | b83dd69b3328bccca38dba50e7e2cb46df79519920347ca542f605a2239a7470 |
Hashes for toad-0.0.64a1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6031f71a2caa27bb8056990aed14ef8355157d82adbe5d0657f90f5e9d47107 |
|
MD5 | 701ccc54a6acff16756ed602ee2dd075 |
|
BLAKE2b-256 | 0f578a27a990e7016ce04f9bfd82a38a9860aedeacee102bfdc1c9ba6d86928f |
Hashes for toad-0.0.64a1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e4ea17b4384492aa072fe52641db4a5f40831079d6cf34e366944c34a4aee93 |
|
MD5 | 8416a0a71f8e60d3910f4f5c21250ba2 |
|
BLAKE2b-256 | 1a200a72adf0c93405cd711ac9400bf5c2076c6203017a63b5c279a4ebec2646 |
Hashes for toad-0.0.64a1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aba17d4876065dea2bbc5bdfda9803f5e9b4927c0163174e0ec2d0f383de88dc |
|
MD5 | 42414d284a757da071e1560cb7409b28 |
|
BLAKE2b-256 | 8550fbd54cd1d1e2110928c3ea80bfb4e0a9ab2fc7f08f14f0c3f9f70259278f |
Hashes for toad-0.0.64a1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04d2dc66ca0aca4f5d4ab688d56254b23f5bf5c12e5b3066fa678f425a3d0990 |
|
MD5 | 90df93eeb95e9d964a6f3b7d9553fbe3 |
|
BLAKE2b-256 | 12b1f9b72322a150d81a5386edc4c7000f2c96dd5ac511d69f0d9e5d05c40dc0 |
Hashes for toad-0.0.64a1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b66bbfc3a387a3de66415ce5189f51209715e2f450d19bd76a4671a3b03875a0 |
|
MD5 | 239377abe6eb1a86aa662520397ae927 |
|
BLAKE2b-256 | ed228d91da937af85d3d26a456f55f007657f360250a5bc76c86092a7542d813 |
Hashes for toad-0.0.64a1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cde2eec257102403d85878efe1ec8fb2e6490cde17865d6a2dff106458cd63dc |
|
MD5 | 18e4a4c745765aea0569f6e04f0f963c |
|
BLAKE2b-256 | 3807d72d25c65f1b13e582fdb4cf82d705c201b6daa21835b5c401584846aa4d |
Hashes for toad-0.0.64a1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d805546274c06b3ec2bed0ad22904b5f22f9a2b778eb1b5643225a23ed6ccd07 |
|
MD5 | ab45a6dcafb0238f2ec4d178a829462c |
|
BLAKE2b-256 | f648a9e349573596ab65d492850fec4823f4e57c3e3f9549fdf32bcd4a6df273 |