ShichenXie / scorecardpy

Scorecard Development in python, 评分卡
http://shichen.name/scorecard
MIT License
725 stars 301 forks source link

is non continuous binning possible? #46

Closed catapiqui closed 1 year ago

catapiqui commented 4 years ago

I am working with another version of the dataset where, for exmaple "Purpose" was changed from qualitative to categorical, where:

car (new) -> 0 
car (used) -> 1
furniture/equipment -> 2
radio/television -> 3
domestic appliances -> 4
repairs -> 5
education -> 6
retraining -> 8
business -> 9
others -> 10

I would like to bin them, for example, business and education, so 6 and 9, but if I specify

breaks_list = {
      'Purpose': ['6%,%9']
    }

the model will bin from 6 to 9, not 6 & 9. I tried saying "6 or 9" and it didn't work either. Is it possible to do this?

Thank you for working so hard on this library!

ShichenXie commented 4 years ago

Try this, breaks_list = { 'Purpose': ['6%,%9', '0%,%1%,%2%,%3%,%4%,%5%,%7%,%8'] }