ShichenXie / scorecardpy

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

woebin_ply bug #73

Open GISH123 opened 3 years ago

GISH123 commented 3 years ago

When applying woebin into a dataframe, there is a occasional bug that happens if:

1) that feature has missing value; 2) in woebin, you make a bin with special value = 0

Example: a This feature will be ok applying on a dataframe, since it has no special value

!However, the following two feature: b If the to-be-applied dataframe has value 0, it will be given woe = -0.841608( [-inf,0.1) bin ) which is false should be 0.529374 instead.

I kind of quick fixed by trying to force where my original data value = 0, I give it the true woe value(0.529374) instead. image

Summary in traditional chinese: 簡單來說就是如果該dataframe,該特徵有missing value且在woebin有設定special value = 0,則所有0會被給予下一個(bin)分箱的值

ShichenXie commented 3 years ago

I know the woebin_adj function is not so stable. I'll fix it if I have time in the future. You can try to use the R version package which is much mature.

GISH123 commented 3 years ago

Well, at least outside of this particular problem, the woebin_adj work wonders. Quickfixing it doesn't take much time too. Thank you for your reply.