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.0.65-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dccfe09e56f9d31fcfb876249277dba20737071b7a42b8540bfdfd36ce18690e |
|
MD5 | 906dfafd7692567b5fed1923be7c6eb2 |
|
BLAKE2b-256 | d81f81637f2ecc0baa44843c13428ca3ae3818df81b455a2d554efd7da0ab3d7 |
Hashes for toad-0.0.65-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85a68a006736e00fe015bb5f879d8b1320a305ec4d896a60608137ea4e76fc47 |
|
MD5 | 1c51516894e24a0f63ac4210986e2ebe |
|
BLAKE2b-256 | 2959cbfacb3efd41696cffbe54088049f09aa369cfb867bf5811645672731c37 |
Hashes for toad-0.0.65-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f702028bd944c493ec9fae6d06cbe3382721248122e8d2f45798986de68cea2e |
|
MD5 | dffa81d937914fd276c9f95feabd04f2 |
|
BLAKE2b-256 | f68d3ecbe502e23001f5ddaaef9857191c5ef66b2498aa02b5e9ce845f10790a |
Hashes for toad-0.0.65-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0fbfe9667525d2548a0e31e24fca2a72f5d3ce3e401b374609298cecc7ae23d |
|
MD5 | 4737ff447242dc405695de921d80d54d |
|
BLAKE2b-256 | 11dbe283e9e219517a81f54584bc1c09fd93b4a59a5758c70940bde1952e464f |
Hashes for toad-0.0.65-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d33f8afe676a165a0b6973aa5c2bf68a33d66b54afae72dadb708e7457cbbba |
|
MD5 | 6800c0325d528612aa05a782980c50c2 |
|
BLAKE2b-256 | 121d0e25d3fa7e640e2092b1d5db545e9b4f5350f600a0538ff76e0f620f67a3 |
Hashes for toad-0.0.65-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 576f35b10d77f0335055540b33621c4734ad95d99e862d22e7f711cef2910eae |
|
MD5 | 5c4d42e8e097836c7cf6a908cb230cfd |
|
BLAKE2b-256 | ca517af2defedbfc3ad142c765434ee9f0e277c91c2e4e36c0a1776344ddfc08 |
Hashes for toad-0.0.65-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e88d617188955962196771d03965252bed4d04121f7be08a5506602eb8b87083 |
|
MD5 | 8f54fc074a1c381478f63798a40e4c16 |
|
BLAKE2b-256 | 2fe963c0a6c3b10693efded43f7f2735d553584a5d7b36c019901885d997beda |
Hashes for toad-0.0.65-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38adf66078df7f95a3c647d2c986141d8fe309097e570cacd6d62a1e129f1619 |
|
MD5 | 088d82d74989d19df683ab66b3b1b24b |
|
BLAKE2b-256 | 3938c232a2693008e997d3f716a9f61fd1052c123c1c5ca8e7136e8cf5bb128a |
Hashes for toad-0.0.65-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 821825e0ffd8705ddebefc071da84e44e4dbb555f6744c603c94173e2b98d1cf |
|
MD5 | 852bfc09e2e366ae54d2c3e71f65a55e |
|
BLAKE2b-256 | c71942f38a47d198bd36206c4a34ad2267cd4d8e9f9db9c22755f238f6485405 |
Hashes for toad-0.0.65-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55990c440699060b25dcfa6ecd76396fd4ecf08ac895a7a9b87d296d7962826b |
|
MD5 | 57e272d2928c4af1893a337bfc51f5ca |
|
BLAKE2b-256 | ff925425df802ab506886059edf995e27a337d46ad3b91e6b124fb7bf24e7d89 |