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.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d331097224c9dffeb33d65474fe48d1d13a1bed108af2592984bc06fe786b9 |
|
MD5 | b7a21e996391644c6a88de6969903804 |
|
BLAKE2b-256 | 693430e283744d3215bd4116392dcd15b81f5144ac3437f6727169b6883304b6 |
Hashes for toad-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b85d5deae1e41c8d285d23cde32c1f869195b31f91bda424717f17d5a3db744 |
|
MD5 | 39c8f3a5052204765dbeba73bbc44ab4 |
|
BLAKE2b-256 | 3a73739329a9dd711cddcf99c74bfd3880fb4b22a351f6175a46f4229a7b0cb8 |
Hashes for toad-0.1.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4fdd6dff2ee19258e04317503e56249190d3d7f03c68a3672a0f273881ba143 |
|
MD5 | 8b0b034b20428ac180aa2e862cc03502 |
|
BLAKE2b-256 | 119c2eabed5a96ab58bde280280a1f3792858a489a2d01114e43cdaafc74f998 |
Hashes for toad-0.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 503a5ebc35576172be727051b94b1ba8976f040d233ce6cf8e3d937eded39eb9 |
|
MD5 | ad0a10419514198750377013fb3c2ede |
|
BLAKE2b-256 | 43c280163430f21a4bc5690e37ae6618e2bbe59244ec96476eee1dee98c209bf |
Hashes for toad-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c71507c1c8ef5968f698417c7af203307b91a54d6d6e61efa1a9d27a6d1090cc |
|
MD5 | 89e7820c6691f3db29c0daf859f37b22 |
|
BLAKE2b-256 | 7cb974e17c69597d71c10e2b8f517a7fb6ce1b7784594572a059415fbac45eaa |
Hashes for toad-0.1.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9afb9ccca0c0afa0eb7e37e9d56749a7b57df708caa4fe9cf411993d4e5ec4e |
|
MD5 | 72dcd7c65c3730323b3c16c78300919b |
|
BLAKE2b-256 | 121c0fe80edae1411c83ea7fc34cab630d8046ec3930e16a2d027af4c9125e9b |
Hashes for toad-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f08871829dad34ab9dab6291cd87fb5b3dda1c007a19ba64e13b1542109351e9 |
|
MD5 | d3cdf0bdef4aa1ffa59cd27bb85306a5 |
|
BLAKE2b-256 | c5c57207cec71c185920e91c9e426d889fdc0cff355b5ec7cb49552a7ae87b42 |
Hashes for toad-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86cb56b1f810aac602ffc96d143868fcafb10d315c46f040fa9290bf69bf27fc |
|
MD5 | 979ffd4a8233edda569a50cd931303ba |
|
BLAKE2b-256 | de19afd9bf5132227799b0eb371ec3e4dd9de1b5ebcdab8dbafa2894d21eb45a |
Hashes for toad-0.1.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2878dbd41f085eeeb81755b0cfe99f9db4a5db47bf8f9ba19fc288594aa0e0e8 |
|
MD5 | 0e218b6c5790b0bf06b74d3e8fbc31e5 |
|
BLAKE2b-256 | ad7a438cd76bbf47eec1ad4cd41b3dfa076b5df2cbc873fea6ae333c4198cf29 |
Hashes for toad-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ba4056c7977db4f2ec04c697bfb703685cfddfedcb2eecab2480a451a6daf3a |
|
MD5 | eb70d04b217e757396ca245b10587808 |
|
BLAKE2b-256 | 8ee849ce04a11c2e5d3e72bcb4769b1c5f9567988086192086390c4fad85e47d |