Giter Club home page Giter Club logo

xxdscorecard's Introduction

XXDScorecard

安装

pip install XXDScorecard

使用

scorecard developing utilities.

import XXDScorecard.XXDBinning as binning

from sklearn.model_selection import train_test_split

df = pd.read_csv('data.csv')

train_df, test_df = train_test_split(df,test_size=0.3,random_state=100,stratify=df.flgGood)

数值型

nb = binning.XXDNumberBin()

1. 数值型等频分箱

nb.pct_bin(train_df,'req_inc_ratio','flgGood',max_bin=10)

2. 分箱结果

nb.get_bin_stats()

3. WOE图

nb.plot_woe()

4. 测试集转woe

nb.trans_to_woe(test_df['req_inc_ratio'])

5. 手动调整分箱

nb.manual_bin(train_df,'req_inc_ratio','flgGood',[20,30,40])

6. 自动单调分箱

nb.monotone_bin(train_df,'req_inc_ratio','flgGood',max_bin=3)

字符型

1. 自动分箱

cb = binning.XXDCharBin()

cb.pct_bin(train_df,'name','flgGood')

2. woe图

cb.plot_woe()

3. 分箱结果

cb.get_bin_stats()

4. 字符型手动分箱

cb.manual_bin(train_df,'name','flgGood',[['yuqing','xuxiaodong'],['jack ma'],['yq','dd','xxd','qq']])

5. 测试集转woe

cb.trans_to_woe(test_df['name'])

xxdscorecard's People

Contributors

xxd626 avatar

Stargazers

 avatar  avatar  avatar jonyao avatar  avatar  avatar

Forkers

rockkb idachun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.